[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

number->string should use either no exponent or an e-exponent

This page is part of the web mail archives of SRFI 77 from before July 7th, 2015. The new archives for SRFI 77 contain all messages, not just those from before July 7th, 2015.



I think number->string without an explicit precision (and hence write)
should be defined to use either no exponent or an e-exponent when its
argument satisfies flonum?

Scheme A considers exponentless, d-exponent, l-exponent, e-exponent
literals as flonums and writes flonums with a d-exponent. Scheme B
considers only exponentless, l-exponent, and e-exponent literals as
flonums and writes flonums with an e-exponent. Both Scheme A and Scheme
B satisfy write-read invariance for flonums as required by SRFI 77, but
when Scheme B reads a flonum written by Scheme A, the result is not a
flonum.

Now, we cannot force inexact numbers to have the same value from
implementation to implementation, but I think a flonum should stay a
flonum, regardless of whatever happens to its value. If not, one has to
filter all flonum input through real->flonum before using the
flonum-specific procedures. Ugh.

Regards,

Alan