I don't know where the NaN is being manipulated, there are lots
of design issues that could be addressed using it.

Note that there are huge numbers of NaNs -- a NaN has a reserved
exponent; the fraction part can be used to encode info.

You might also see how infinities are handled.

A NaN can be thought of as resembling "0/0"  if you want to put
it into the rational number almost-field.  Then you have only one of
them.

There are papers that describe what you might do.

Here's one, about 20 years old.
http://www.cs.berkeley.edu/~fateman/papers/retrodiag.pdf



On Mar 22, 9:14 am, Robert Bradshaw <rober...@math.washington.edu>
wrote:
> On Wed, Mar 21, 2012 at 7:39 PM, kcrisman <kcris...@gmail.com> wrote:
>
> > On Mar 21, 10:00 pm, Gonzalo Tornaria <torna...@math.utexas.edu>
> > wrote:
> >> In sage 4.8:
>
> >> sage: NaN - NaN
> >> sage: 0
> >> sage: NaN + NaN
> >> 2*NaN
> >> sage: NaN * NaN
> >> NaN^2
>
> > Naturally!  Since NaN is a symbolic expression, apparently:
>
> > sage: type(NaN)
> > <type 'sage.symbolic.expression.Expression'>
>
> > See  sage/symbolic/constants.py, e.g.
> >http://hg.sagemath.org/sage-main/file/c239be1054e0/sage/symbolic/cons...
> > Based on the code in that file, I think that means this is the Pynac
> > NaN.
>
> This is horrendous. Better to not have this "constant" (at least not
> in the global namespace) than behavior like this. The top level NaN,
> if we want one, could be in RR (precision doesn't really matter for
> this value).
>
> - Robert

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to