Re: +-Inf and NaN
Richard Fateman <[email protected]> Fri, 23 Feb 2024 17:46:28 -0800
| Newsgroups | gmane.comp.mathematics.maxima.general,gmane.lisp.gcl.devel |
|---|---|
| Message-ID | <CADB8Zm4g3yRznzrQDAdu26QM2i4zvDkq5B3EB=W6s7c=r0S-hQ@mail.gmail.com> |
Since Maxima has symbols that are not float NaNs for inf, minf, infinity, undefined, indefinite... it would seem superficially plausible to unite these notations. Not easy. For solving inf-inf --> not zero, i've proposed and partially implemented the idea that inf, as well as und, should be indexed each time it is generated. Thus x: 1/0 returns und[1]. y: 1/0 returns und[2] x-x returns 0. x-y is und[1]-und[2] --> und[3]. how to implement? lots of patches. Here's another: allow rational numbers 1/0 and 0/0 and maybe -1/0 On Fri, Feb 23, 2024 at 11:05 AM Stavros Macrakis <[email protected]> wrote: > On Fri, Feb 23, 2024 at 12:20 PM Henry Baker <[email protected]> wrote: > >> ...There was a reason why Maclisp used a separate function name for float >> >> arithmetic functions, and it wasn't just to speed up float arithmetic. >> > > Actually, that was precisely why. (plus a b) was be translated to (+$ a b) > if a and b were of type float. > > The real reason is that *floats don't adhere to standard algebraic axioms*. >> > > Well, since *plus* invokes floating point operations, it has the same > issues. > > >> In particular, standard "=" needs to be an *equivalence relation*, which >> >> means transitivity, among other things, so floating point needs its own >> >> brain-damaged 'equality' predicate -- perhaps IEEE-= >> > > Extending data types with an NA value is pretty standard and useful, and > not just for floats. One of these days (ha ha), we'll even get Maxima to > realize that INF-INF does not equal 0, and that not all INFs are equal. > > _______________________________________________ Maxima-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/maxima-discuss