gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] Numerical conversion between integral and float


From: Camm Maguire
Subject: Re: [Gcl-devel] Numerical conversion between integral and float
Date: 19 Feb 2004 23:12:54 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!  Can this wait for 2.7.x?  Especially as I don't know what
the right thing to is.  see the recent discussion on the maxima
mailing list regarding nans and infs.

Take care,

"Mike Thomas" <address@hidden> writes:

> Hi all.
> 
> On GCL the following occurs:
> 
> ==================================================================
> >(- (expt 2 (expt 2 (expt 2 (expt 2 2)))) 0.5)
> 
> Error in SYSTEM:TOP-LEVEL [or a callee]: Can't print a non-number.
> 
> Fast links are on: do (use-fast-links nil) for debugging
> Broken at PRIN1.  Type :H for Help.
>  1 (Continue) Return to top level.
> ==================================================================
> 
> The integral value is too large for the floating point representation and so
> the attempt to convert for subtraction of a float doesn't work:
> 
> Corman CL handles this as:
> 
> (- (expt 2 (expt 2 (expt 2 (expt 2 2)))) 0.5)
> ;;; An error occurred in function -:
> ;;; Error: The number
> 
> ...Giant number elided by yours truly...
> 
>  is too large in magnitude to be converted to a SINGLE-FLOAT
> ;;; Entering Corman Lisp debug loop.
> ;;; Use :C followed by an option to exit. Type :HELP for help.
> ;;; Restart options:
> ;;; 1   Abort to top level.
> 
> 
> LW eval gives:
> 
> (- (expt 2 (expt 2 (expt 2 (expt 2 2)))) 0.5)
> +1D++0 #| +1D++0 is double-float plus-infinity |#
> 
> 
> I like the Corman message best of all, but I don't know if that is the Right
> Thing To Do re ANSI and numerical correctness.
> 
> Cheers
> 
> Mike Thomas.
> 
> 
> 
> 
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]