number printing problems in 5.9.3.99rc2 xmaxima on windows/GCL



On 8/28/06, Richard Fateman <fateman at cs.berkeley.edu> wrote:

> I think it is better to intercept such exceptional operands on their way
> to getting printed, which requires only a small change in nformat.  We
> need a way to test for "exceptional-number",  and checking for inf (+ or
> -) and NaN.

Agreed. If we intercept, we can ensure that the printed output is
the same on any Lisp implementation which allows special values
to be computed.

I am inclined to use the existing symbols inf and minf to print
positive and negative floating point infinities, and use the symbol nan
to print not-a-number. (ind and und are other possibilities, but I don't
know that the treatment of und and ind is consistent with not-a-number.)

I would further suggest assigning a a $numer property for inf and minf,
and maybe nan, so that they evaluate to the corresponding floating point
values when requested. Dunno how well that's going to fly.

> Note that not all NaNs are bitwise the same. They just have a pecular
> exponent.

Yes. There are ranges of values, all of which are not-a-numbers.
If we wanted to get nutty we could output something like
nan(7FFF000000000000) or whatever to disambiguate.

Robert