10000 gh-119613: deprecate Py_IS_NAN/INFINITY and Py_IS_FINITE · skirpichev/cpython@5070e5c · GitHub
[go: up one dir, main page]

Skip to content

Commit 5070e5c

Browse files
committed
pythongh-119613: deprecate Py_IS_NAN/INFINITY and Py_IS_FINITE
1 parent a531fd7 commit 5070e5c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Doc/whatsnew/3.14.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ Optimizations
103103
Deprecated
104104
==========
105105

106-
106+
* Deprecate ``Py_IS_NAN``, ``Py_IS_INFINITY`` and ``Py_IS_FINITE`` macroses,
107+
use instead ``isnan``, ``isinf`` and ``isfinite`` available from ``<math.h>``
108+
since C99. (Contributed by Sergey B Kirpichev in :gh:`119619`.)
107109

108110
Removed
109111
=======

Include/pymath.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
#define Py_MATH_TAU 6.2831853071795864769252867665590057683943L
2828
#endif
2929

30+
/* Py_IS_NAN, Py_IS_INFINITY and Py_IS_FINITE are deprecated
31+
* since CPython 3.14.
32+
*/
33+
3034
// Py_IS_NAN(X)
3135
// Return 1 if float or double arg is a NaN, else 0.
3236
#define Py_IS_NAN(X) isnan(X)

0 commit comments

Comments
 (0)
0