intertwingly

It’s just data

Updated Decimal Implementation


10

I’ve added decimal literals and support for both unary and binary operators on top of SpiderMonkey.  My approach is that when all arguments are Decimal, the results are Decimal; otherwise the precision is lost.  An example to make it clear:

js> 1.21  - 1.11
0.09999999999999987
js> 1.21  - 1.11m
0.09999999999999987
js> 1.21m - 1.11
0.09999999999999987
js> 1.21m - 1.11m
0.10

More details here.  Code here.  Mozilla tracking here.