Greetings!
Richard Fateman <[email protected]> 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 [email protected]
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
_______________________________________________
Gcl-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gcl-devel