diff Doc/c-api/complex.rst @ 74025:059e4d752fbe 2.7

Issue #13522: document error return values of some float and complex C API functions.
author Antoine Pitrou <solipsis@pitrou.net>
date Sun, 18 Dec 2011 01:25:27 +0100
parents 13dc65fe8599
children 2863470caebb
line wrap: on
line diff
--- a/Doc/c-api/complex.rst	Sat Dec 17 01:17:17 2011 +0200
+++ b/Doc/c-api/complex.rst	Sun Dec 18 01:25:27 2011 +0100
@@ -63,12 +63,18 @@
    Return the quotient of two complex numbers, using the C :ctype:`Py_complex`
    representation.
 
+   If *divisor* is null, this method returns zero and sets
+   :cdata:`errno` to :cdata:`EDOM`.
+
 
 .. cfunction:: Py_complex _Py_c_pow(Py_complex num, Py_complex exp)
 
    Return the exponentiation of *num* by *exp*, using the C :ctype:`Py_complex`
    representation.
 
+   If :attr:`exp.imag` is not null, or :attr:`exp.real` is negative,
+   this method returns zero and sets :cdata:`errno` to :cdata:`EDOM`.
+
 
 Complex Numbers as Python Objects
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -125,6 +131,7 @@
 .. cfunction:: Py_complex PyComplex_AsCComplex(PyObject *op)
 
    Return the :ctype:`Py_complex` value of the complex number *op*.
+   Upon failure, this method returns ``-1.0`` as a real value.
 
    .. versionchanged:: 2.6
       If *op* is not a Python complex number object but has a :meth:`__complex__`