mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
[3.14] gh-141004: Document Py_RETURN_NAN and Py_RETURN_INF (GH-141029) (GH-141074)
gh-141004: Document `Py_RETURN_NAN` and `Py_RETURN_INF` (GH-141029)
(cherry picked from commit 5b02c6e920)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
This commit is contained in:
parent
11eecde7a5
commit
090c0f1403
1 changed files with 17 additions and 0 deletions
|
|
@ -78,6 +78,23 @@ Floating-Point Objects
|
|||
Return the minimum normalized positive float *DBL_MIN* as C :c:expr:`double`.
|
||||
|
||||
|
||||
.. c:macro:: Py_RETURN_NAN
|
||||
|
||||
Return :data:`math.nan` from a function.
|
||||
|
||||
On most platforms, this is equivalent to ``return PyFloat_FromDouble(NAN)``.
|
||||
|
||||
|
||||
.. c:macro:: Py_RETURN_INF(sign)
|
||||
|
||||
Return :data:`math.inf` or :data:`-math.inf <math.inf>` from a function,
|
||||
depending on the sign of *sign*.
|
||||
|
||||
On most platforms, this is equivalent to the following::
|
||||
|
||||
return PyFloat_FromDouble(copysign(INFINITY, sign));
|
||||
|
||||
|
||||
Pack and Unpack functions
|
||||
-------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue