[issue15544] math.isnan fails with some Decimal NaNs

Stefan Krah report at bugs.python.org
Fri Aug 3 21:41:48 CEST 2012


Stefan Krah added the comment:

> OTOH, IEEE 754 *does* cover floating-point to int conversions (5.4.1, 5.8):  those fall under 'general-computational operations', and as such should signal when given an sNaN.

That sounds good. Let's keep the ValueError then. We could consider
InvalidOperation like with Decimal('snan').to_integral(), but that's
probably confusing in the context of the math module.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15544>
_______________________________________


More information about the Python-bugs-list mailing list