https://github.com/python/cpython/commit/a5650e42ac1c2c62ac7d83807e28224882cecd57 commit: a5650e42ac1c2c62ac7d83807e28224882cecd57 branch: 3.13 author: Sergey B Kirpichev <[email protected]> committer: vstinner <[email protected]> date: 2025-11-18T14:32:48+01:00 summary:
[3.13] gh-141004: Document Py_HUGE_VAL/IS_FINITE/IS_INFINITE/IS_NAN (GH-141544) (#141700) (cherry picked from commit 630cd37bfae0fc4021d9e9461b94d36e7ce6b95c) Co-authored-by: Victor Stinner <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]> files: M Doc/c-api/float.rst diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index ad63359bf9b15e..d5b1c2334592b1 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -96,6 +96,14 @@ Floating-Point Objects the C11 standard ``<math.h>`` header. +.. c:macro:: Py_HUGE_VAL + + Equivalent to :c:macro:`!INFINITY`. + + .. deprecated:: 3.14 + The macro is :term:`soft deprecated`. + + .. c:macro:: Py_MATH_E The definition (accurate for a :c:expr:`double` type) of the :data:`math.e` constant. @@ -140,6 +148,34 @@ Floating-Point Objects return PyFloat_FromDouble(copysign(INFINITY, sign)); +.. c:macro:: Py_IS_FINITE(X) + + Return ``1`` if the given floating-point number *X* is finite, + that is, it is normal, subnormal or zero, but not infinite or NaN. + Return ``0`` otherwise. + + .. deprecated:: 3.14 + The macro is :term:`soft deprecated`. Use :c:macro:`!isfinite` instead. + + +.. c:macro:: Py_IS_INFINITY(X) + + Return ``1`` if the given floating-point number *X* is positive or negative + infinity. Return ``0`` otherwise. + + .. deprecated:: 3.14 + The macro is :term:`soft deprecated`. Use :c:macro:`!isinf` instead. + + +.. c:macro:: Py_IS_NAN(X) + + Return ``1`` if the given floating-point number *X* is a not-a-number (NaN) + value. Return ``0`` otherwise. + + .. deprecated:: 3.14 + The macro is :term:`soft deprecated`. Use :c:macro:`!isnan` instead. + + Pack and Unpack functions ------------------------- _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
