Quick Question! Many thanks in advance.
why does the following give 7000000000000000000 and not 7704160246533127889 :
uint a = 20000
int b = 259683854649
answer = (a / (uint(b) / 10e8) * 10e18;
Quick Question! Many thanks in advance.
why does the following give 7000000000000000000 and not 7704160246533127889 :
uint a = 20000
int b = 259683854649
answer = (a / (uint(b) / 10e8) * 10e18;
Solved it:
uint a = 20000
uint b = uint(259683854649) / 1e8;
answer = ((a* 1e5 / b + 5) / 10) * 1e14;