Re: +-Inf and NaN

Stavros Macrakis <[email protected]> Wed, 28 Feb 2024 12:51:14 -0500
Newsgroups gmane.comp.mathematics.maxima.general,gmane.lisp.gcl.devel
Message-ID <CACLVabX=+eMLpWUTwf66wb-YMusunJeLf7A5PhDPZexY-zTFEg@mail.gmail.com>
On Wed, Feb 28, 2024 at 11:18 AM Raymond Toy <[email protected]> wrote:

> On Wed, Feb 28, 2024 at 7:38 AM Stavros Macrakis <[email protected]>
> wrote:
>
>> 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 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.
>>
>
> I think we'll just have to agree to disagree.  In a previous life I used
> to do simulations for the physical layer for cellular systems.  These would
> often take many hours (or days) to run.  If I messed up and accidentally
> did 1/0 because I forgot to initialize something, then after hours or days,
> all of the printed results were basically NaN.  I could have saved hours or
> days if I got an ERROR at the point where I divided by 0.  IIRC this
> usually happened fairly early in the code, not at the end....
>

I have nothing against being able to enable error signaling when a NaN is
generated.
In any case, I doubt many Maxima users are doing long-running numerical
calculations.
And as for me, I would be happier to find a few NaNs at special points
(singularities, boundaries, ...) than to have nothing.
I guess it all depends on the specific calculation.

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