From d2a1cbe24323cd491d14a4e003b3c5955df4266e Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Fri, 14 Nov 2025 05:00:35 +0300 Subject: [PATCH 1/3] gh-141004: document Py_HUGE_VAL/IS_FINITE/IS_INFINITE/IS_NAN --- Doc/c-api/float.rst | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index 79de5daaa90d8f..35cbe379b25ec8 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -99,6 +99,14 @@ Floating-Point Objects the C11 standard ```` header. +.. c:macro:: Py_HUGE_VAL + + Same as :c:macro:`Py_INFINITY`. + + .. deprecated:: 3.14 + The macro is soft deprecated. + + .. c:macro:: Py_MATH_E The definition (accurate for a :c:expr:`double` type) of the :data:`math.e` constant. @@ -147,6 +155,32 @@ Floating-Point Objects return PyFloat_FromDouble(copysign(INFINITY, sign)); +.. c:macro:: Py_IS_FINITE + + Determines if the given floating-point number has finite value i.e. it is + normal, subnormal or zero, but not infinite or NaN. + + .. deprecated:: 3.14 + The macro is soft deprecated. Use :c:macro:`!isfinite` instead. + + +.. c:macro:: Py_IS_INFINITE + + Determines if the given floating-point number arg is positive or negative + infinity. + + .. deprecated:: 3.14 + The macro is soft deprecated. Use :c:macro:`!isinf` instead. + + +.. c:macro:: Py_IS_NAN + + Determines if the given floating-point number is a not-a-number (NaN) value. + + .. deprecated:: 3.14 + The macro is soft deprecated. Use :c:macro:`!isnan` instead. + + Pack and Unpack functions ------------------------- From 202c27fd072130bce5ff654b32aa82dcf57081be Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Fri, 14 Nov 2025 05:03:22 +0300 Subject: [PATCH 2/3] +1 --- Doc/c-api/float.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index 35cbe379b25ec8..748398e61e2987 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -166,7 +166,7 @@ Floating-Point Objects .. c:macro:: Py_IS_INFINITE - Determines if the given floating-point number arg is positive or negative + Determines if the given floating-point number is positive or negative infinity. .. deprecated:: 3.14 From b1d30c37a7df0ee15161546b9cffec073f78d6a9 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Fri, 14 Nov 2025 18:02:19 +0300 Subject: [PATCH 3/3] address review: Py_HUGE_VAL & :term:`soft deprecated` --- Doc/c-api/float.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index 748398e61e2987..fac3c39c502663 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -87,7 +87,7 @@ Floating-Point Objects ```` header. .. deprecated:: 3.15 - The macro is soft deprecated. + The macro is :term:`soft deprecated`. .. c:macro:: Py_NAN @@ -101,10 +101,10 @@ Floating-Point Objects .. c:macro:: Py_HUGE_VAL - Same as :c:macro:`Py_INFINITY`. + Equivalent to :c:macro:`Py_INFINITY`. .. deprecated:: 3.14 - The macro is soft deprecated. + The macro is :term:`soft deprecated`. .. c:macro:: Py_MATH_E @@ -161,7 +161,7 @@ Floating-Point Objects normal, subnormal or zero, but not infinite or NaN. .. deprecated:: 3.14 - The macro is soft deprecated. Use :c:macro:`!isfinite` instead. + The macro is :term:`soft deprecated`. Use :c:macro:`!isfinite` instead. .. c:macro:: Py_IS_INFINITE @@ -170,7 +170,7 @@ Floating-Point Objects infinity. .. deprecated:: 3.14 - The macro is soft deprecated. Use :c:macro:`!isinf` instead. + The macro is :term:`soft deprecated`. Use :c:macro:`!isinf` instead. .. c:macro:: Py_IS_NAN @@ -178,7 +178,7 @@ Floating-Point Objects Determines if the given floating-point number is a not-a-number (NaN) value. .. deprecated:: 3.14 - The macro is soft deprecated. Use :c:macro:`!isnan` instead. + The macro is :term:`soft deprecated`. Use :c:macro:`!isnan` instead. Pack and Unpack functions