[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Comments and some bugs
* From: Jens Axel Søgaard <jensaxel@xxxxxxxxxxxx>
> (fmt -5.0 0 #\space 10 + 'e)
| . fmt: exact number cannot have a decimal point
| 10 depth (and depth (eq? exactness (quote e))) ; Why not?
> (fmt -5 0 #\space 10 + 'e)
| . fmt: exact number cannot have a decimal point 10 depth (and depth (eq? exactness (quote e)))
R5RS says: If the written representation of a number has no exactness prefix,
the constant may be either inexact or exact. It is inexact if it contains a
decimal point, an exponent, or a "#" character in the place of a digit,
otherwise it is exact.
What the above says is that if the reader sees a number *without exactness prefix*
such as "-5.0" then it by default shall read it as inexact if there is decimal dot.
If there is an exactness prefix the above rule doesn't apply since, it is obvious
whether the number read is exact or inexact.
> (exact? #e-5.0)
> (exact? -5.0)
Jens Axel Søgaard