Subject: NaNs etc. in Maxima (WAS: float to bfloat)
From: Stavros Macrakis
Date: Mon, 26 Jan 2004 18:35:15 -0500
> test integer-decode-float on NaN, Infinity, etc.
> before you decide your program is correct.
Maxima currently doesn't handle even floating-point operations on NSN's
correctly.... Consider:
2.0^10000 => print error
2.0^10000-2.0^10000 => bind stack overflow (in Maxima formatter)
is(2.0^2000 > 2.0^10000) => true
So it's no surprise that float/bfloat conversion would have problems
with them, too....
Maxima also generally signals errors rather than returning NSNs, e.g.
1/0, 1.0/0.0, 0.0^0.0, etc. There is no way currently to tell Maxima to
instead return signalling or non-signalling NSNs. Same thing for
integrate(x,x,0,inf)=> Error/divergent (could be simply INF) and
integrate(sin(x),x,0,inf)=> Error/divergent (could be simply IND).
As Richard has pointed out before, Maxima has many more options open to
it than IEEE floats do. For example, comparison operators have
tetrachotomy (<, =, >, unknown) rather than trichotomy, so we don't have
to do the IEEE float hack where both 1 < NaN is false and NaN < 1 is
false.
-s