Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: About exact results and exact endpoints



On Feb 13 2013, Hossam A. H. Fahmy wrote:
On Tue, 2013-02-12 at 21:30 -0800, Richard Fateman wrote:

It is amusing to consider that [1/3, 0.1d0] could either be converted,
with some loss,
to two floats [0.3333...3, 0.1d0]
or without loss to two rationals,
[1/3,   3602879701896397/ 2^55]

In fact, 3602879701896397/ 2^55 =
0.1000000000000000055511151231257827021181583404541015625
and not 0.1.
It is impossible to get an exact rational representation of the vast
majority of decimal fractions using only a power of 2 denominator. That
is the mathematical reason that lead to the inclusion of decimal
floating point specification in IEEE 754-2008.

I am sorry, but that misuse of the word "mathematical" sticks in my
gullet.

The fact that a fixed size of decimal floating-point can represent a
wider range of decimal fractions than binary (and a stronger statement
does not hold) is no different from the fact that a binary one can
represent a wider range of binary fractions than decimal.  There was
and is no mathematical reason that ten is a preferred base over two,
or even three.

The claims of extra accuracy for decimal floating-point are polemic,
pure and simple, and precisely the converse can be argued with rather
more reference to mathematics.  Please leave it out of this discussion.


Regards,
Nick Maclaren.