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.
1 parent 2679d35 commit 86b35f1Copy full SHA for 86b35f1
Doc/c-api/float.rst
@@ -82,12 +82,23 @@ Floating-Point Objects
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
+ if (copysign(1., sign) == 1.) {
96
+ return PyFloat_FromDouble(INFINITY);
97
+ }
98
+ else {
99
+ return PyFloat_FromDouble(-INFINITY);
100
101
102
103
Pack and Unpack functions
104
-------------------------
0 commit comments