toRational (0.9)

S.D.Mechveliani mechvel@math.botik.ru
Wed, 18 Apr 2001 15:31:34 +0400


Jerzy Karczmarczuk <karczma@info.unicaen.fr> writes


| 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.
| [..]


The matter is in what the _language standard_ says.
If it puts that `0.9' in the user program means precizely  9%10, 
then Lennart is right.
As I never used such things like `0.9', I would take, so far, what 
the language experts say.

-----------------
Serge Mechveliani
mechvel@botik.ru