toRational (0.9). Reply

Jerzy Karczmarczuk karczma@info.unicaen.fr
Wed, 18 Apr 2001 12:55:00 +0100


Lennart Augustsson wrote:

> "S.D.Mechveliani" wrote:
...                 ...
> > Probably, the source of a `bug' is a language agreement that the
> > input is in decimal representation (`0.9') and its meaning is a
> > floating approximation in _binary_ representation.
> 
> What are you talking about?  Input in decimal representation is
> stored as a Rational number.  There is absolutely no loss of
> precision.

No need for whatareyoutalkingabout preamble.
Input in decimal representation *in general* is stored as the
implementors wish. You can't a priori know all, if you are far
from the implementors, and if the relevant documentation is
hard to find... How many people on this mailing list are really
au courant?

I had a few weeks ago a very nasty surprise: the "educational
variant/teaching language" of Rice DrScheme stores a decimal
constant as an EXACT number, and the "full language" as a
floating INEXACT. For two days I thought that the function 'floor'
is buggy.


Jerzy Karczmarczuk
Caen, France