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.
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.