Monday, March 16th, 2009
So what’s the solution?
There is work on a decimal flavor of IEEE 754, and we looked at incorporating it into the next edition of ECMAScript. Unfortunately, adding a second number type to a language having only one can do a lot of violence to the language, so we deferred consideration of the decimal type to a future edition. Also, the proposed decimal type is extremely slow in execution, and to my eye is much too complicated in its specification.
When using a rich-type language, you can always tell when a developer is working on their first e-commerce application: he’ll use floating points instead of integers (or higher-level accurate decimal helpers, like BigDecimal in Java) to perform currency-related math.
Posted by Ben Galbraith at 7:59 am