Skip to content

Commit

Permalink
pythongh-119613: deprecate Py_IS_NAN/INFINITY and Py_IS_FINITE
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed May 29, 2024
1 parent a531fd7 commit 5070e5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ Optimizations
Deprecated
==========


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

Removed
=======
Expand Down
4 changes: 4 additions & 0 deletions Include/pymath.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#define Py_MATH_TAU 6.2831853071795864769252867665590057683943L
#endif

/* Py_IS_NAN, Py_IS_INFINITY and Py_IS_FINITE are deprecated
* since CPython 3.14.
*/

// Py_IS_NAN(X)
// Return 1 if float or double arg is a NaN, else 0.
#define Py_IS_NAN(X) isnan(X)
Expand Down

0 comments on commit 5070e5c

Please sign in to comment.