Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
Floats are not perfect. You can check if the value is something specific (if you are aware of what values going wrong) and after subtracting with 0.1, add 0.000001 to the result.
Posts: 73
Threads: 13
Joined: Oct 2012
Reputation:
0
Wierd thing is that if I subtract 0.1 from 15.1 it'll become 15.0.
Is there anyway to do this without floats? Strings maybe?
Posts: 4,885
Threads: 57
Joined: Jun 2012
Reputation:
0
That loss of precision is too small to have any major effect rule of thumb when working with floats use >= and <=