Uh oh!
There was an error while loading. Please reload this page.
gh-119613: use C99+ functions instead of Py_IS_NAN/INFINITY/FINITE - #119619
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Eclips4
commented
May 27, 2024
@tim-one is there an on-going reason to have these portability macros? Are NaN values guaranteed to be supported? |
skirpichev
commented
May 28, 2024
vstinner
left a comment
There was a problem hiding this comment.
LGTM. Simple text replacement.
vstinner
commented
May 28, 2024
Python 3.10 and older supported platforms without IEEE 754, without NaN, and without C99 #ifndefPy_IS_NAN#if defined HAVE_DECL_ISNAN&&HAVE_DECL_ISNAN==1#definePy_IS_NAN(X) isnan(X)
#else#definePy_IS_NAN(X) ((X) != (X))
#endif#endifPython 3.11 and newer requires IEEE 754, NaN and C99 #definePy_IS_NAN(X) isnan(X)Issues:
See also this LWN article: CPython, C standards, and IEEE 754. |
vstinner
commented
May 28, 2024
@mdickinson: Are you ok with this change? You wrote a comment about these macros there: #119457 (comment) |
mdickinson
commented
May 28, 2024
Yes, absolutely. I'm fairly sure the macros were born out of (now somewhat ancient) portability needs that no longer apply, now that C99 (and later) adoption is sufficiently widespread. I'd suggest running all buildbots on this PR, just to be on the safe side. |
bedevere-bot
commented
May 28, 2024
🤖 New build scheduled with the buildbot fleet by @mdickinson for commit 13dcd12 🤖 If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
skirpichev
commented
May 29, 2024
There are tests failures, but hardly it's related to the pr. Something expected, given there are not build bots for non-IEEE-754 platforms, right? |
mdickinson
commented
May 29, 2024
Agreed - the failures look unrelated. |
vstinner
commented
May 29, 2024
Merged, thanks. |
Uh oh!
There was an error while loading. Please reload this page.