gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] NaN and Infinities in GCL, Maxima


From: Camm Maguire
Subject: Re: [Gcl-devel] NaN and Infinities in GCL, Maxima
Date: Tue, 05 Mar 2013 12:41:41 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Greetings!

Richard Fateman <address@hidden> writes:

> On 3/5/2013 7:57 AM, Camm Maguire wrote:
>> Thanks.  Do you think the nan should = itself?
> =  should compare not equal
> eq should presumably say t
>

For the same nan, yes, otherwise no, right?

> dunno about eql

If eq, then eql must follow, otherwise follow = and return nil, right?


I have a patch which passes this little tester.  What does it overlook?


(setq si::*print-nans* t)
(setq +inf (funcall (compile nil '(lambda nil (/ 1.0 0.0)))))
(setq -inf (funcall (compile nil '(lambda nil (/ -1.0 0.0)))))
(setq nan (funcall (compile nil '(lambda nil (/ 0.0 0.0)))))
(defvar *l* (list +inf nan -inf 0.0 1.0 -1.0))
(mapc (lambda (x) 
        (mapc (lambda (y) 
                (mapc (lambda (z &aux (o (print (list x y z)))
                                 (r2 (funcall (compile nil `(lambda (x y) 
                                                              ; The compiler 
will currently unbox and rebox declared long-floats
                                                              ,@(unless (member 
z '(eq eql equal equalp))
                                                                  `((declare 
(long-float x y))))
                                                              (,z x y))) x y))
                                 (r1 (if (and (eq z '/) (eql y 0.0)) r2 
(funcall z x y))));Skip div by zero error
                        (unless (or (eql r1 r2) (and (si::isnan r1) (si::isnan 
r2)))
                          (print (list x y z r1 r2))
                          (break))) '(/ * + - < > <= >= = /= eq eql equal 
equalp))) *l*)) *l*)
-- 
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]