[r6rs-discuss] Two questions about writing inexact numbers
Alan Watson
alan at alan-watson.org
Tue May 29 16:38:41 EDT 2007
Alan Watson wrote:
> John Cowan replied (off-list, but forwarded here with his permission):
>
> > If I mean "I want to be able to write a flonum on one implementation and
> > guarantee (within range restrictions) that it will be read as a flonum
> > on any other implementation",
>
> Technically you can't do that at all, since the flonums are an
> implementation-dependent subset of the inexact reals. As of 5.91
> (I haven't checked more recently) it was conformant for the only
> flonum to be 0.0.
I would consider that a "range restriction"[*]. However, currently, even
if two implementations agree on the subset of inexact numbers that are
flonums, I cannot simply write a flonum in one in such a way that is
guaranteed to be read as a flonum in the other.
Regards,
Alan
[*] If I am not mistaken, a Scheme implementation is allowed to have
only, say, 0.0 or 3.141526 or any other single value as its entire set
of inexact numbers (and need not implement NaNs or infinities). Who said
inexact numbers were a burden on lightweight Scheme implementations? :-)
More information about the r6rs-discuss
mailing list