Re:0.3 - 0.2 == 0.2 - 0.1 is falsy. Which language gets this...
by anonymouz on Thursday October 04, 2012 @03:11PM
(#4613827)
This seems to be a very sensible default way to handle the comparison, assuming the programmer already knows about the problems with floating point math. A programmer who does not know about that will probably trip up sooner or later no matter how the language implements comparison.
So personally I would not see it as "right" (or "wrong"), simply because it is a choice between many different methods with their own advantages and disadvantages. I view this not as a problem a language can (or has to) solve, but as one a programmer has to be aware of and has to solve depending on his particular application.
So personally I would not see it as "right" (or "wrong"), simply because it is a choice between many different methods with their own advantages and disadvantages. I view this not as a problem a language can (or has to) solve, but as one a programmer has to be aware of and has to solve depending on his particular application.