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.


Unnecessary word to mark links when in fact the preceding words were perfectly fine to label the link itself here. ;)

This looks awesome. I can’t believe that this industry still gets by using binary representation for decimal numbers.

Posted by Jesper at

This looks awesome. I can’t believe that this industry still gets by using binary representation for decimal numbers.

I couldn’t agree more.  Nice work, Sam.

Posted by Scott Johnson at

More tracking; SunSpider output

Posted by Sam Ruby at

Add your comment