Hello I know that computer is limited by number precision, and some numbers cannot be represented accurately in binary system. That’s why I'm asking why such comparison
(0.1*3) == 0.3
in Java language evaluates to false
while in C it evaluates to true
, for me the Java behavior is a little bit more intuitive. Any of provided answers does not answer my question why they have different behaviors, since both use IEEE 754 standard.
@update I was using ideone to test condition.