]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-141004: document Py_INFINITY and Py_NAN macros (#141145)
authorSergey B Kirpichev <skirpichev@gmail.com>
Tue, 11 Nov 2025 10:13:59 +0000 (13:13 +0300)
committerGitHub <noreply@github.com>
Tue, 11 Nov 2025 10:13:59 +0000 (11:13 +0100)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Doc/c-api/float.rst

index 9e703a46445dce8b3483a396e9d5ca6fec1f203d..eae4792af7d2999901e1aaf0dda06fac3b316a00 100644 (file)
@@ -78,6 +78,24 @@ Floating-Point Objects
    Return the minimum normalized positive float *DBL_MIN* as C :c:expr:`double`.
 
 
+.. c:macro:: Py_INFINITY
+
+   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
+   the C11 standard ``<math.h>`` header.
+
+
+.. c:macro:: Py_NAN
+
+   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
+   the C11 standard ``<math.h>`` header.
+
+
 .. c:macro:: Py_MATH_El
 
    High precision (long double) definition of :data:`~math.e` constant.