Two interoperable implementations rule

Mike Cowlishaw MFC at
Wed Jul 16 00:41:04 PDT 2008

Mark wrote:

> Adding decimal to Rhino would presumably build on the BigDecimal 
> class already present in Java. Is Java's BigDecimal class 
> sufficiently conformant to the relevant IEEE spec to support a 
> conformant implementation of the decimal proposed for EcmaScript? 

It follows the same arithmetic rules, but is not a complete implementation 
of IEEE 754 (in particular, it does not have Infinity and NaNs, or 
malleable exponent range limits, and hence its overflow/exception cases 
are different.  Sun were talking of either extending it or providing a 
wrapper class which used it yto provide exact IEEE 754 conformance, but I 
do not know the status of that work item.

> And is the implementation sufficiently independent of the 
> implementation the IBM guys might add to WebKit or Spidermonkey to 
> count as a cross check on the spec? 

Well, I wrote most of the Java 5 extensions to BigDecimal (including the 
MathContext support, etc.), so one might argue that it's not particularly 
independent.  However, it is a completely different implementation, 

> IBM guys, would you be interested in contributing such a decimal 
implementation to Rhino? 

BigDecimal is 'owned' by Sun, so not really something we could contribute.


Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

More information about the Es4-discuss mailing list