News for hackers. Stuff that matters.
Re:0.3 - 0.2 == 0.2 - 0.1 is falsy. Which language gets this... by CurtHagenlocher on Thursday October 04, 2012 @11:20AM (#4612716)
I suspect COBOL got this "right"...

In C#, (0.3m - 0.2m) == (0.2m - 0.1m). The latest version of the C++ spec allows for user-defined literals, so you could do something similar there (with caveats). But as far as I know, there's no modern language in widespread use that has decimal literals which default to base-ten representations.

Re:0.3 - 0.2 == 0.2 - 0.1 is falsy. Which language gets this... by rst on Thursday October 04, 2012 @11:52AM (#4612883)
Some SQL implementations seem to. In Postgres:

  test=# select (0.3 - 0.2) - 0.1;
   ?column? 
  ----------
        0.0
  (1 row)
(Ruby gives me -2.77555756156289e-17)