#16515: Every RDF number compares equal to float NaN
-------------------------------------------------+-------------------------
Reporter: tcoffee | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.3
Component: coercion | Resolution:
Keywords: RDF RealDoubleField float NaN | Merged in:
equal number | Reviewers:
Authors: | Work issues:
Report Upstream: N/A | Commit:
Branch: | Stopgaps:
Dependencies: |
-------------------------------------------------+-------------------------
Description changed by tcoffee:
Old description:
> Any number in !RealDoubleField compares equal to Python's floating-point
> NaN (which is not even true of NaN itself):
>
> {{{
> sage: nan = float('nan')
> sage: RDF(123) == nan
> True
> sage: nan == nan
> False
> }}}
>
> This bit me quite easily: I used a Python script that converted a number
> to RDF (imported from Sage) to take advantage of a built-in method, did
> more calculations with it, and checked if the result was NaN. It always
> was.
New description:
Any number in !RealDoubleField compares equal to Python's floating-point
NaN (which is not even true of NaN itself):
{{{
sage: nan = float('nan')
sage: RDF(123) == nan
True
sage: nan == nan
False
}}}
This bit me quite easily: I used a Python script that converted a number
to RDF (imported from Sage) to take advantage of a built-in method, did
more calculations with it, and compared it with each of a sequence of
numbers that included a NaN value, which spuriously returned True.
--
--
Ticket URL: <http://trac.sagemath.org/ticket/16515#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.