[armedbear-devel] Readably printing of #<SINGLE-FLOAT NaN>s and #<DOUBLE-FLOAT NaN>s
Erik Huelsmann
ehuels at gmail.com
Mon Jun 15 15:12:48 UTC 2009
Last week I found that - although I requested information to be
printed readably - NaNs are printed unreadable, without generating an
error. I'd really like to fix this, especially because it broke the
expectation of readable input after succesfull save.
At first, I thought I'd print it as #.SYS::SINGLE-FLOAT-NAN However,
that has the disadvantage that it's definitely non-portable. However,
some implementations have a mode where (/ 0.0s0 0.0s0) results in a
NaN instead of a DIVISION-BY-ZERO.
The new proposal is to print NaN as #.(/ 0.0s0 0.0s0) and #.(/ 0.0d0
0.0d0) respectively, if readable printing is requested; non-readable
printing can stay as it is (ie using #<...>). That works (is readable
input) for ABCL. For SBCL, this is readable input if it's in IEEE
mode. With respect to any of the other Lisps, I have no idea.
Comments?
With kind regards,
Erik.
More information about the armedbear-devel
mailing list