Next:
7.5 Other Objects
Up:
7.4 Numeric Objects
Previous:
Floating Point Objects
Complex Number Objects
Py_complex
The C structure which corresponds to the value portion of a Python complex number object. Most of the functions for dealing with complex number objects use structures of this type as input or output values, as appropriate. It is defined as:
typedef struct { double real; double imag; } Py_complex;
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
.
Py_complex
_Py_c_sum
(
Py_complex, Py_complex
)
Py_complex
_Py_c_diff
(
Py_complex, Py_complex
)
Py_complex
_Py_c_neg
(
Py_complex
)
Py_complex
_Py_c_prod
(
Py_complex, Py_complex
)
Py_complex
_Py_c_quot
(
Py_complex, Py_complex
)
Py_complex
_Py_c_pow
(
Py_complex, Py_complex
)
PyObject *
PyComplex_FromCComplex
(
Py_complex
)
PyObject *
PyComplex_FromDoubles
(
double real, double imag
)
double
PyComplex_RealAsDouble
(
PyObject *op
)
double
PyComplex_ImagAsDouble
(
PyObject *op
)
Py_complex
PyComplex_AsCComplex
(
PyObject *op
)
guido@python.org