On Wed, Dec 7, 2011 at 12:11 PM, Fredrik Johansson
I see. This was actually pointed out to me after I wrote this email.
Any idea why they did that?
So how would you recommend that we do things with Float in SymPy. We
can either keep it like it is, but add some kind of way to tell if
it's nan. Right now, we are testing Float._mpf_ against fnan from
mpmath.libmp.libmpf which is not very stable, and also not very
user-friendly. So we would add some kind of .is_nan property. Or, we
can break this convention, and have Float('nan') == Float('nan') be
There's also the question of how this should behave with SymPy's S.NaN
if we choose the first option. Right now, we have S.NaN == S.NaN is
True (indeed, S.NaN is S.NaN is True, since it's singletonized).
Should we have S.NaN == Float('nan') be True (assuming we choose the
first option; obviously it would be if we choose the second one)? And
how about float('nan') == Float('nan') or float('nan') == S.NaN?
I've also added the SymPy list to this discussion, since this is more
of a problem there than here, though I am interested in your opinion,
as you know more about these floating point things than I do (and
probably most people on the SymPy list).