[New-bugs-announce] [issue46640] Python can now use the C99 NAN constant

STINNER Victor report at bugs.python.org
Fri Feb 4 15:24:09 EST 2022


New submission from STINNER Victor <vstinner at python.org>:

While debugging a GCC regression (*) on "HUGE_VAL * 0" used by Py_NAN macro, I noticed that Python can now C99 "NAN" constant.

(*) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104389

In bpo-45440, I already removed legacy code for pre-C99 support and old platforms:

"Building Python now requires a C99 <math.h> header file providing the following functions: copysign(), hypot(), isfinite(), isinf(), isnan(), round()."

Attached patch modifies Py_NAN to simply reuse NAN.

mathmodule.c and cmathmodule.c m_nan() still use _Py_dg_stdnan() by default (if PY_NO_SHORT_FLOAT_REPR is not defined).

----------
components: Interpreter Core
messages: 412531
nosy: vstinner
priority: normal
severity: normal
status: open
title: Python can now use the C99 NAN constant
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46640>
_______________________________________


More information about the New-bugs-announce mailing list