mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-141004: soft-deprecate Py_INFINITY macro (#141033)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
c6f3dd6a50
commit
e2026731f5
13 changed files with 45 additions and 36 deletions
|
|
@ -18,14 +18,14 @@ PyAPI_DATA(PyTypeObject) PyFloat_Type;
|
|||
|
||||
#define Py_RETURN_NAN return PyFloat_FromDouble(Py_NAN)
|
||||
|
||||
#define Py_RETURN_INF(sign) \
|
||||
do { \
|
||||
if (copysign(1., sign) == 1.) { \
|
||||
return PyFloat_FromDouble(Py_INFINITY); \
|
||||
} \
|
||||
else { \
|
||||
return PyFloat_FromDouble(-Py_INFINITY); \
|
||||
} \
|
||||
#define Py_RETURN_INF(sign) \
|
||||
do { \
|
||||
if (copysign(1., sign) == 1.) { \
|
||||
return PyFloat_FromDouble(INFINITY); \
|
||||
} \
|
||||
else { \
|
||||
return PyFloat_FromDouble(-INFINITY); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
PyAPI_FUNC(double) PyFloat_GetMax(void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue