From 56740f181e4faf76a1053f5d063d1bd262d66c30 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Thu, 6 Nov 2025 17:16:21 +0300 Subject: [PATCH 1/5] gh-141004: document Py_INFINITY macro --- Doc/c-api/float.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index 1085c32a537071..3e6381545fde24 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -78,6 +78,15 @@ Floating-Point Objects Return the minimum normalized positive float *DBL_MIN* as C :c:expr:`double`. +.. c:macro:: Py_INFINITY + + This is equivalent of :c:macro:`!INFINITY` from the C11 standard + ```` header. + + .. deprecated:: 3.15 + The macro is soft deprecated. + + .. c:macro:: Py_RETURN_NAN Return :data:`math.nan` from a function. From 33bbedcef4c2273c15284d739ed9216d0d088d83 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Thu, 6 Nov 2025 21:45:46 +0300 Subject: [PATCH 2/5] Update Doc/c-api/float.rst Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- 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 3e6381545fde24..501a32c5bac95b 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -80,7 +80,7 @@ Floating-Point Objects .. c:macro:: Py_INFINITY - This is equivalent of :c:macro:`!INFINITY` from the C11 standard + This is equivalent to the :c:macro:`!INFINITY` macro from the C11 standard ```` header. .. deprecated:: 3.15 From 4a7d572c59d95abcf6c4357b84ed7cc7022c3d95 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Tue, 11 Nov 2025 02:09:42 +0300 Subject: [PATCH 3/5] Update Doc/c-api/float.rst --- Doc/c-api/float.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index 91e6ae6da361ce..fe749406bed6cb 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -83,9 +83,6 @@ Floating-Point Objects This is equivalent to the :c:macro:`!INFINITY` macro from the C11 standard ```` header. - .. deprecated:: 3.15 - The macro is soft deprecated. - .. c:macro:: Py_MATH_El From 81d373dc550a8600926c38fbe758e48317da2a2a Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Tue, 11 Nov 2025 02:22:37 +0300 Subject: [PATCH 4/5] + document Py_NAN --- Doc/c-api/float.rst | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index fe749406bed6cb..10855247cfdae2 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -80,8 +80,20 @@ Floating-Point Objects .. c:macro:: Py_INFINITY - This is equivalent to the :c:macro:`!INFINITY` macro from the C11 standard - ```` header. + This macro expands a to constant expression of type :c:type:`double`, that + represents the positive infinity. + + On most platforms, this is equivalent to the :c:macro:`!INFINITY` macro from + the C11 standard ```` header. + + +.. c:macro:: Py_NAN + + This macro expands a to constant expression of type :c:type:`double`, that + represents a quiet not-a-number (qNaN) value. + + On most platforms, this is equivalent to the :c:macro:`!NAN` macro from + the C11 standard ```` header. .. c:macro:: Py_MATH_El From eeb7fb3ecb7de272ca50c050c5062020ea2fc58e Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Tue, 11 Nov 2025 03:00:37 +0300 Subject: [PATCH 5/5] +1 --- Doc/c-api/float.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index 10855247cfdae2..eae4792af7d299 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -80,7 +80,7 @@ Floating-Point Objects .. c:macro:: Py_INFINITY - This macro expands a to constant expression of type :c:type:`double`, that + This macro expands a to constant expression of type :c:expr:`double`, that represents the positive infinity. On most platforms, this is equivalent to the :c:macro:`!INFINITY` macro from @@ -89,7 +89,7 @@ Floating-Point Objects .. c:macro:: Py_NAN - This macro expands a to constant expression of type :c:type:`double`, that + This macro expands a to constant expression of type :c:expr:`double`, that represents a quiet not-a-number (qNaN) value. On most platforms, this is equivalent to the :c:macro:`!NAN` macro from