Re: +-Inf and NaN
Stavros Macrakis <[email protected]> Wed, 21 Feb 2024 16:20:18 -0500
| Newsgroups | gmane.comp.mathematics.maxima.general,gmane.lisp.gcl.devel |
|---|---|
| Message-ID | <CACLVabWaxTL2U24OgxxnU-AdXcdJMwJrLH=DcbySttPw=91V5A@mail.gmail.com> |
On Wed, Feb 21, 2024 at 1:46 PM Raymond Toy <[email protected]> wrote: > ... > I think CLHS isn't really super clear on IEEE floats. > CL was defined before IEEE floats existed. > ...I agree with what Robert says. Compilation safety here should change > the computed results for valid inputs. > I think you mean *should not change*, right? > 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 >> > Don't agree. If you're doing a calculation with more than one result, it is perfectly reasonable for some of the results to be NaNs and other results to be valid. Aborting the calculation is not the right thing to do. Ray Toy: > NaN is an important part of preventing numeric calculations from giving > incorrect results. > Not quite sure what you mean by this because NaN is, in a sense, an incorrect result because we couldn't represent what was asked, like 0d0/0d0 or inf-inf. It isn't "incorrect", it's invalid. And arithmetic with it should preserve invalidity. The incorrect result happens if 0.0*NaN gives 0.0 rather than NaN, so you think you have a valid result when you don't. -s _______________________________________________ Maxima-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/maxima-discuss