Re: +-Inf and NaN

Stavros Macrakis <[email protected]> Wed, 28 Feb 2024 10:37:56 -0500
Newsgroups gmane.comp.mathematics.maxima.general,gmane.lisp.gcl.devel
Message-ID <CACLVabUwn6F5PRze0XLHyi9UkV3qeijCR6C-=foFGX2AKs9jew@mail.gmail.com>
On Wed, Feb 28, 2024 at 10:12 AM Raymond Toy <[email protected]> wrote:

> On Wed, Feb 28, 2024 at 5:44 AM Camm Maguire <[email protected]>
> wrote:
>
>> ...
>> > I hope you will consider changing the default to trap on invalid
>> > operations so that instead of returning NaN, an error is signaled.  ...
>> >
>>
>> This is good to hear, as I was of the opposite impression that most
>> users wanted NaNs to propagate freely.
>>
>
> Maybe you should take a poll or something.  It could be that I'm just a
> terrible numerical programmer.  But in my experience, it's fairly easy to
> produce an infinity somewhere which then gets subtracted from infinity that
> then becomes NaN which then poisons all further computations.
>

I disagree vehemently. The behavior of NaN is extremely useful. For
example, it is nice that [1,2,3]/[2.0,0.0,2.0] returns [0.5,NaN,1.5] rather
than just ERROR.

R found this kind of behavior so useful in statistical calculations (where
"missing value" is a reasonable thing to calculate with) that they added it
to *all* numeric types, not just floats.

        -s

_______________________________________________
Maxima-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maxima-discuss