Skip to content
Prev 177615 / 398503 Next

bug when subtracting decimals?

Try this:

0.7-0.3==0.4
(We get FALSE)
0.7-0.3<0.4
(We get TRUE)

but
0.8-0.3==0.5
(TRUE)
0.8-0.3<0.5
(FALSE)

Funny, he?

There is a way around: 
round(0.7-0.3,1)==0.4
(TRUE)

Obviously there is a problem with some combinations of decimal subtractions,
that - we have the feeling - shouldt be solved.

Best regards
Sven & Wolfgang