Re: +-Inf and NaN
Stavros Macrakis <[email protected]> Tue, 20 Feb 2024 20:12:38 -0500
| Newsgroups | gmane.comp.mathematics.maxima.general,gmane.lisp.gcl.devel |
|---|---|
| Message-ID | <CACLVabUbDFRB0SwDOWqJrgUuqTn66ONJ1YnfmfJ6P3AftoruLA@mail.gmail.com> |
Signaling NaNs are another matter. But preventing, say, IEEEinf-IEEEinf from returning 0 is really important in numeric code. On Tue, Feb 20, 2024 at 7:40 PM Henry Baker <[email protected]> wrote: > A while ago I reported some experiments with 'signalling' Nan's, and > concluded that they were worthless, as there wasn't enough info left > at interrupt time to do anything interesting, and if you built the > structures > needed to do something interesting, then you would still be better off > with an explicit check and explicitly branch to the corresponding code. > > I came away from that experience with a really bad taste in my mouth > w.r.t. NaN's, so I would be very supportive of getting NaN's out of the > way of doing more important things. > > -----Original Message----- > From: Camm Maguire <[email protected]> > Sent: Feb 20, 2024 3:58 PM > To: Robert Dodier <[email protected]>, <[email protected]>, < > [email protected]> > Cc: <[email protected]> > Subject: [Maxima-discuss] +-Inf and NaN > > 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 [email protected] > ========================================================================== > "The earth is but one country, and mankind its citizens." -- Baha'u'llah > > > _______________________________________________ > Maxima-discuss mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > > > > > _______________________________________________ > Maxima-discuss mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > _______________________________________________ Maxima-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/maxima-discuss