gcl-devel
[Top][All Lists]
Advanced

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

[Gcl-devel] Re: [Maxima] float(sin(2^2048))?


From: Camm Maguire
Subject: [Gcl-devel] Re: [Maxima] float(sin(2^2048))?
Date: Thu, 13 May 2010 14:27:15 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Greetings!


Maxima 5.21.1 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (a.k.a. GCL)
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) :lisp (setq si::*print-nans* t)

T
(%i1) :lisp (float (expt 2 2049) 1.0e0)

#<inf>
(%i1) 


To my understanding, we can't make this the default due to ansi
compliance considerations.  But I'm not the language lawyer.

Simple enough to set this up within maxima when using gcl.

Take care,

Richard Fateman <address@hidden> writes:

> Stavros Macrakis wrote:
>
>     Things like this do not seem worth special-casing. Floating-point has
>     well-understood limitations, and Maxima offers bfloat when you want to
>     escape (some of) them.
>     
>     It would be far more valuable in general if we could integrate IEEE
>     floats into Maxima (in this case, getting a NaN). But that is a bigger
>     project....
>
> I agree that allowing NaNs should be considered, but I think that this is not 
> supported sufficiently
> by all the Lisps.  In particular, GCL says "Can't print a non-number" when 
> given a NaN
>
> (try:   
>   :lisp (float (expt 2 2049) 1.0e0)
>
> )
>
> Maybe all the other lisps are better??? (CL standard does not deal with this 
> issue).
>
> Another thought is that Maxima can do much better with symbolic expressions 
> than a purely-numeric
> system, and therefore could have lots more information that just NaN.  For 
> example,  if
> sin(2^2048)  is problematical, just leave it as 'sin(2^2048)  rather than NaN.
> RJF
>
>              -s
>
>     On 2010-05-11, Raymond Toy <address@hidden> wrote:
>
>         What should maxima do with float(sin(2^2048))?  It currently generates
>         an error because 2^2048 is too big to fit in a double float.
>         
>         We could do better than this by doing argument reduction of 2^2048.
>         
>         Or the easy way is to tell the user to do float(bfloat(sin(2^2048))).
>         Should maxima do that automatically?
>         
>         Ray
>         
>         _______________________________________________
>         Maxima mailing list
>         address@hidden
>         http://www.math.utexas.edu/mailman/listinfo/maxima
>
>     _______________________________________________
>     Maxima mailing list
>     address@hidden
>     http://www.math.utexas.edu/mailman/listinfo/maxima
>
> _______________________________________________
> Maxima mailing list
> address@hidden
> http://www.math.utexas.edu/mailman/listinfo/maxima

-- 
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]