ES3.1 Proposal Working Draft
brendan at mozilla.org
Thu Feb 21 01:36:52 PST 2008
On Feb 20, 2008, at 1:25 PM, Mark S. Miller wrote:
> What numbers are representable as double but not decimal?
Mike Cowlishaw's page at http://www2.hursley.ibm.com/decimal/ is
extremely informative, especially http://www2.hursley.ibm.com/decimal/
decifaq.html; see also the link to http://grouper.ieee.org/groups/754/.
See http://www2.hursley.ibm.com/decimal/decifaq6.html#bindigits and
double to decimal conversion answers. As http://wiki.ecmascript.org/
* A very small amount of precision which may be present in a double-
precision binary fp number is lost during a double → decimal
promotion, but that:
o No precision is lost in an integral → decimal promotion.
o Reading a numeric lexeme as a decimal preserves more precision
than reading it as a double.
> Does decimal have NaN, Infinity, -Infinity,
Yes -- from the ES4 RI:
> and -0.0?
> (Btw, I never liked -0.0. And I especially dislike ES3's
> behavior that 0.0 === -0.0. However, I would argue against making
> incompatible changes to this.)
Guy Steele edited Edition 1 of ECMA-262 and argued for both of these
parts of the standard, based on precedent in related programming
languages, as well as advice in IEEE-754 itself. He pointed out
something important to numerical programmers: you can walk around the
four quadrants using signed zeros with atan2:
More information about the Es4-discuss