Added by: ~guest, 2011 VII 27, Last modified by: tomek, 2011 VII 28
| Type: | other |
|---|---|
| Status: | closed |
| Progress: | 100 |
i am using ttmath released 0.9.2.
99999.9 - 99999.8 operation's result is not 0.1
is 0.099999999 etc..
is it bug?
Added by: tomek, 2011 VII 28
No it's not a bug, floating point numbers cannot precisely represent all real numbers:Added by: ~Bertyhell, 2012 I 27
I always wondered
isn't it possible to round every calculation by the number of decimals digits - 1
eg:
542.9999999999 (10 digits past the comma)
round(542.9999999999, 9) = 543
or is the number of digits behind the comma not always the same?