mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
This PR removes `_Py_dg_stdnan` and `_Py_dg_infinity` in favour of using the standard `NAN` and `INFINITY` macros provided by C99. This change has the side-effect of fixing a bug on MIPS where the hard-coded value used by `_Py_dg_stdnan` gave a signalling NaN rather than a quiet NaN. --------- Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
6 lines
381 B
ReStructuredText
6 lines
381 B
ReStructuredText
Fix ``float("nan")`` to produce a quiet NaN on platforms (like MIPS) where
|
|
the meaning of the signalling / quiet bit is inverted from its usual
|
|
meaning. Also introduce a new macro ``Py_INFINITY`` matching C99's
|
|
``INFINITY``, and refactor internals to rely on C99's ``NAN`` and
|
|
``INFINITY`` macros instead of hard-coding bit patterns for infinities and
|
|
NaNs. Thanks Sebastian Berg.
|