Skip to content

Commit a5650e4

Browse files
skirpichevvstinnerStanFromIreland
authored
[3.13] gh-141004: Document Py_HUGE_VAL/IS_FINITE/IS_INFINITE/IS_NAN (GH-141544) (#141700)
(cherry picked from commit 630cd37) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
1 parent 1bca1b4 commit a5650e4

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

Doc/c-api/float.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ Floating-Point Objects
9696
the C11 standard ``<math.h>`` header.
9797
9898
99+
.. c:macro:: Py_HUGE_VAL
100+
101+
Equivalent to :c:macro:`!INFINITY`.
102+
103+
.. deprecated:: 3.14
104+
The macro is :term:`soft deprecated`.
105+
106+
99107
.. c:macro:: Py_MATH_E
100108
101109
The definition (accurate for a :c:expr:`double` type) of the :data:`math.e` constant.
@@ -140,6 +148,34 @@ Floating-Point Objects
140148
return PyFloat_FromDouble(copysign(INFINITY, sign));
141149
142150
151+
.. c:macro:: Py_IS_FINITE(X)
152+
153+
Return ``1`` if the given floating-point number *X* is finite,
154+
that is, it is normal, subnormal or zero, but not infinite or NaN.
155+
Return ``0`` otherwise.
156+
157+
.. deprecated:: 3.14
158+
The macro is :term:`soft deprecated`. Use :c:macro:`!isfinite` instead.
159+
160+
161+
.. c:macro:: Py_IS_INFINITY(X)
162+
163+
Return ``1`` if the given floating-point number *X* is positive or negative
164+
infinity. Return ``0`` otherwise.
165+
166+
.. deprecated:: 3.14
167+
The macro is :term:`soft deprecated`. Use :c:macro:`!isinf` instead.
168+
169+
170+
.. c:macro:: Py_IS_NAN(X)
171+
172+
Return ``1`` if the given floating-point number *X* is a not-a-number (NaN)
173+
value. Return ``0`` otherwise.
174+
175+
.. deprecated:: 3.14
176+
The macro is :term:`soft deprecated`. Use :c:macro:`!isnan` instead.
177+
178+
143179
Pack and Unpack functions
144180
-------------------------
145181

0 commit comments

Comments
 (0)