Out of range floating point number determination



Not sure why you say "not looking promising".  You've shown that SBCL
Maxima won't (incorrectly) return a non-finite number in this case.

But does the non_finite code correctly detect such numbers if passed them?
You may want to test by generating an Inf and NaN in Lisp (if SBCL supports
that).

                  -s

On Mon, Aug 13, 2012 at 7:03 AM, Rupert Swarbrick <rswarbrick at gmail.com>wrote:

> Stavros Macrakis <macrakis at alum.mit.edu> writes:
> > I'd be interested to know whether this works on other
> > implementations.
>
> Not looking promising on SBCL:
>
>   Maxima 5.28.0 http://maxima.sourceforge.net
>   using Lisp SBCL 1.0.58
>   Distributed under the GNU Public License. See the file COPYING.
>   Dedicated to the memory of William Schelter.
>   The function bug_report() provides bug reporting information.
>   (%i1) non_finite(x) := not is(x-x = 0.0)$
>
>   (%i2) xinf: float(10^400)$
>
>   Maxima encountered a Lisp error:
>
>    Too large to be represented as a DOUBLE-FLOAT:
>     100000000000000000000[...snip lots of zeros...]00
>
>   Automatically continuing.
>   To enable the Lisp debugger set *debugger-hook* to nil.
>   (%i3) xinf;
>   (%o3)                                xinf
>   (%i4)
>
>
> Where is the error caught when running under GCL? Or does GCL just not
> raise an error?
>
>
> Rupert
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>