We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Py_RETURN_NAN
Py_RETURN_INF
1 parent 11fc411 commit 5b02c6eCopy full SHA for 5b02c6e
Doc/c-api/float.rst
@@ -78,6 +78,23 @@ Floating-Point Objects
78
Return the minimum normalized positive float *DBL_MIN* as C :c:expr:`double`.
79
80
81
+.. c:macro:: Py_RETURN_NAN
82
+
83
+ Return :data:`math.nan` from a function.
84
85
+ On most platforms, this is equivalent to ``return PyFloat_FromDouble(NAN)``.
86
87
88
+.. c:macro:: Py_RETURN_INF(sign)
89
90
+ Return :data:`math.inf` or :data:`-math.inf <math.inf>` from a function,
91
+ depending on the sign of *sign*.
92
93
+ On most platforms, this is equivalent to the following::
94
95
+ return PyFloat_FromDouble(copysign(INFINITY, sign));
96
97
98
Pack and Unpack functions
99
-------------------------
100
0 commit comments