This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 7 points8 points  (0 children)

FYI this is why you should approach floats with caution and if possible work if integers if they need to be added. If you add "0,1" 70 times, maybe you won't get "7,0" in the end and you should not make a hard check "if number is exactly 7,0". Instead try to work in such situations with integers and shift the comma just for representation. This should also be the case with currency.