Decimal operator behaviors

Sam Ruby rubys at
Wed Aug 27 13:41:07 PDT 2008

liorean wrote:
> 2008/8/27 Sam Ruby <rubys at>:
>> I've updated my SpiderMonkey branch based on my understanding of the
>> outcome of the past few days of discussion, and would appreciate any
>> input that people may have on any other operators.  To facilitate this
>> discussion, I've produced the following sets of tables:
> I would be interested in seeing some tests covering the behaviour of
> negative infinity and negative zero as well (for comparison with the
> binary double equivalents's behaviour).

I can certainly add "some" tests, but if you could be a little more 
specific of the actual expressions you would like to see evaluated, I 
will be more likely to produce what you want. :-)

Meanwhile, here's a few examples:

js> -1/0 === 1/0
js> -1m/0m === 1m/0m

js> -0 === 0
js> -0m === 0m

I'll gladly add the lines above to my test suite as well as any others 
you might suggest.  When we get to the named methods, things might get a 
little more interesting:

js> Decimal.compareTotal(-0m,0m)

This has implications for the fabled Object.eq^h^hidentical method.

- Sam Ruby

More information about the Es-discuss mailing list