Yurttas/PL/SL/python/docs/core-python-programming/doc/20/api/node45.html

Revision as of 19:31, 7 November 2013 by MassBot1 (talk | contribs) (Created page with "<div class="navigation"> {| width="100%" cellspacing="2" align="center" | yurttas/PL/SL/python/docs/core-python-programming/doc/20/api/node44.html|[[Image:yurttas_PL_SL...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

7.4.4.2 Complex Numbers as Python Objects

PyComplexObject
This subtype of PyObject represents a Python complex number object.
PyTypeObject PyComplex_Type
This instance of PyTypeObject represents the Python complex number type.
int PyComplex_Check (PyObject *p)
Returns true if its argument is a PyComplexObject.
PyObject* PyComplex_FromCComplex (Py_complex v)
Return value: New reference.
Create a new Python complex number object from a C Py_complex value.
PyObject* PyComplex_FromDoubles (double real, double imag)
Return value: New reference.
Returns a new PyComplexObject object from real and imag.
double PyComplex_RealAsDouble (PyObject *op)
Returns the real part of op as a C double.
double PyComplex_ImagAsDouble (PyObject *op)
Returns the imaginary part of op as a C double.
Py_complex PyComplex_AsCComplex (PyObject *op)
Returns the Py_complex value of the complex number op.

See About this document... for information on suggesting changes.