[issue15544] math.isnan fails with some Decimal NaNs
Antoine Pitrou
report at bugs.python.org
Fri Aug 3 21:49:31 CEST 2012
Antoine Pitrou added the comment:
> > Why not add a is_nan() method to float numbers instead?
>
> Do you mean replacing math.isnan(x) by x.is_nan() to avoid the issue
> altogether? I'm not sure that's possible given that math just wraps
> the C library.
Yup. By calling x.is_nan() you would by construction get an
implementation that's correct for x's type. If x is a float, it would
obviously re-use math.isnan() (or have a similar implementation).
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15544>
_______________________________________
More information about the Python-bugs-list
mailing list