File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,12 +63,18 @@ pointers. This is consistent throughout the API.
6363 Return the quotient of two complex numbers, using the C :c:type:`Py_complex`
6464 representation.
6565
66+ If *divisor* is null, this method returns zero and sets
67+ :c:data:`errno` to :c:data:`EDOM`.
68+
6669
6770.. c:function:: Py_complex _Py_c_pow(Py_complex num, Py_complex exp)
6871
6972 Return the exponentiation of *num* by *exp*, using the C :c:type:`Py_complex`
7073 representation.
7174
75+ If :attr:`exp.imag` is not null, or :attr:`exp.real` is negative,
76+ this method returns zero and sets :c:data:`errno` to :c:data:`EDOM`.
77+
7278
7379Complex Numbers as Python Objects
7480^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -123,4 +129,4 @@ Complex Numbers as Python Objects
123129
124130 If *op * is not a Python complex number object but has a :meth: `__complex__ `
125131 method, this method will first be called to convert *op * to a Python complex
126- number object.
132+ number object. Upon failure, this method returns `` -1.0 `` as a real value.
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ Floating Point Objects
4747 Return a C :c:type: `double ` representation of the contents of *pyfloat *. If
4848 *pyfloat * is not a Python floating point object but has a :meth: `__float__ `
4949 method, this method will first be called to convert *pyfloat * into a float.
50+ This method returns ``-1.0 `` upon failure, so one should call
51+ :c:func: `PyErr_Occurred ` to check for errors.
5052
5153
5254.. c :function :: double PyFloat_AS_DOUBLE (PyObject *pyfloat)
Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ Lee Busby
149149Ralph Butler
150150Nicolas Cadou
151151Jp Calderone
152+ Arnaud Calmettes
152153Daniel Calvelo
153154Tony Campbell
154155Brett Cannon
You can’t perform that action at this time.
0 commit comments