ES Decimal status

David-Sarah Hopwood david.hopwood at industrial-designers.co.uk
Fri Sep 12 13:02:19 PDT 2008


Sam Ruby wrote:
> Description of ES 3.1m decimal support
> 
>      number and decimal are distinct primitive data types.  The
>      former is based on IEEE 754 binary 64 floating point, the latter
>      is based on IEEE 754r decimal 128 floating point.
[...]
>      Conversion from number to decimal is precise and will round trip.

Conversion of number to decimal is not precise.

From
<https://mail.mozilla.org/pipermail/es-discuss/2008-August/007251.html>:

# Decimal is wider, but while every number expressible as a binary64 will
# map to a unique decimal128 value and will round-trip back to the same
# binary64 number[3], it is not the case that the numbers that a binary64
# number maps in decimal128 to map to exactly the same point on the real
# number line as the original binary64 number[4].
#
# [3] http://speleotrove.com/decimal/decifaq6.html#binapprox
# [4] http://speleotrove.com/decimal/decifaq6.html#bindigits

I'm also not sure whether the round-trip property covers all NaNs
(preserving payload), denormal, or unnormal values.

-- 
David-Sarah Hopwood


More information about the Es-discuss mailing list