Skip to content

Commit 630cd37

Browse files
skirpichevvstinnerStanFromIreland
authored
gh-141004: Document Py_HUGE_VAL/IS_FINITE/IS_INFINITE/IS_NAN (#141544)
Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
1 parent 58f3fe0 commit 630cd37

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

Doc/c-api/float.rst

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Floating-Point Objects
8787
``<math.h>`` header.
8888
8989
.. deprecated:: 3.15
90-
The macro is soft deprecated.
90+
The macro is :term:`soft deprecated`.
9191
9292
9393
.. c:macro:: Py_NAN
@@ -99,6 +99,14 @@ Floating-Point Objects
9999
the C11 standard ``<math.h>`` header.
100100
101101
102+
.. c:macro:: Py_HUGE_VAL
103+
104+
Equivalent to :c:macro:`!INFINITY`.
105+
106+
.. deprecated:: 3.14
107+
The macro is :term:`soft deprecated`.
108+
109+
102110
.. c:macro:: Py_MATH_E
103111
104112
The definition (accurate for a :c:expr:`double` type) of the :data:`math.e` constant.
@@ -147,6 +155,34 @@ Floating-Point Objects
147155
return PyFloat_FromDouble(copysign(INFINITY, sign));
148156
149157
158+
.. c:macro:: Py_IS_FINITE(X)
159+
160+
Return ``1`` if the given floating-point number *X* is finite,
161+
that is, it is normal, subnormal or zero, but not infinite or NaN.
162+
Return ``0`` otherwise.
163+
164+
.. deprecated:: 3.14
165+
The macro is :term:`soft deprecated`. Use :c:macro:`!isfinite` instead.
166+
167+
168+
.. c:macro:: Py_IS_INFINITY(X)
169+
170+
Return ``1`` if the given floating-point number *X* is positive or negative
171+
infinity. Return ``0`` otherwise.
172+
173+
.. deprecated:: 3.14
174+
The macro is :term:`soft deprecated`. Use :c:macro:`!isinf` instead.
175+
176+
177+
.. c:macro:: Py_IS_NAN(X)
178+
179+
Return ``1`` if the given floating-point number *X* is a not-a-number (NaN)
180+
value. Return ``0`` otherwise.
181+
182+
.. deprecated:: 3.14
183+
The macro is :term:`soft deprecated`. Use :c:macro:`!isnan` instead.
184+
185+
150186
Pack and Unpack functions
151187
-------------------------
152188

0 commit comments

Comments
 (0)