[issue15544] math.isnan fails with some Decimal NaNs

Steven D'Aprano report at bugs.python.org
Fri Aug 3 11:06:13 CEST 2012


Steven D'Aprano added the comment:

Attached is a patch for decimal.py, and test_decimal.py. I cannot provide a patch for the C decimal implementation, sorry.

Following Mark's suggestion, my patch keeps the sign but discards the payload for quiet NANs, and raises ValueError for signalling NANs.

(I'm ambivalent about signalling NANs raising ValueError, but I guess that's better than having snan silently converted to a quiet nan.)

----------
keywords: +patch
Added file: http://bugs.python.org/file26672/decimalnan.patch

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


More information about the Python-bugs-list mailing list