diff -r ea421c534305 Doc/c-api/complex.rst --- a/Doc/c-api/complex.rst Sat Dec 17 07:08:30 2011 +0100 +++ b/Doc/c-api/complex.rst Sat Dec 17 23:21:22 2011 +0100 @@ -61,13 +61,15 @@ .. c:function:: Py_complex _Py_c_quot(Py_complex dividend, Py_complex divisor) Return the quotient of two complex numbers, using the C :c:type:`Py_complex` - representation. + representation. If ``divisor`` is null, this method returns zero and sets + ``errno`` to ``EDOM``. .. c:function:: Py_complex _Py_c_pow(Py_complex num, Py_complex exp) Return the exponentiation of *num* by *exp*, using the C :c:type:`Py_complex` - representation. + representation. If ``exp.imag`` is not null, or ``exp.real`` is negative, + this method returns zero and sets ``errno`` to ``EDOM``. Complex Numbers as Python Objects @@ -123,4 +125,4 @@ If *op* is not a Python complex number object but has a :meth:`__complex__` method, this method will first be called to convert *op* to a Python complex - number object. + number object. Upon failure, this method returns ``-1.0`` as a real value. diff -r ea421c534305 Doc/c-api/float.rst --- a/Doc/c-api/float.rst Sat Dec 17 07:08:30 2011 +0100 +++ b/Doc/c-api/float.rst Sat Dec 17 23:21:22 2011 +0100 @@ -47,6 +47,8 @@ Return a C :c:type:`double` representation of the contents of *pyfloat*. If *pyfloat* is not a Python floating point object but has a :meth:`__float__` method, this method will first be called to convert *pyfloat* into a float. + This method returns ``-1.0`` upon failure, so one should call + :c:func:`PyErr_Occured` to check for errors. .. c:function:: double PyFloat_AS_DOUBLE(PyObject *pyfloat)