gcl-devel
[Top][All Lists]
Advanced

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

+-Inf and NaN


From: Camm Maguire
Subject: +-Inf and NaN
Date: Tue, 20 Feb 2024 18:17:44 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Greetings!  I know this has been discussed before, but I would like to
explore the possibility of defining these bit patterns as members of a
special type orthogonal to common-lisp::number.  This is prompted by the
NaN blockage on the compiler optimizing (= a a) (or equivalent bindings)
to t, and indeed the common lisp spec appears to specify that eq implies
=.  I think maxima tries to detect NaNs using (/= a a).

We also have the following charming behavior:

(typep nan 'long-float) ->t
(typep nan '(long-float 0) ->nil
(typep nan '(long-float * 0)) ->nil
(typep nan '(or (long-float 0) (long-float * 0))) ->nil

but the first and last types are of course identical.

If NaN was truly 'not a number', the numerical functions would trigger
an error on input only when compiled with safety, and might be arranged
to do likewise on return, so the signatures would remain the same but
the user could still access the values when compiling at (safety 0).
Thoughts?

Take care,
-- 
Camm Maguire                                        camm@maguirefamily.org
==========================================================================
"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]