Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:06:40

0001 #ifndef Py_CPYTHON_COMPLEXOBJECT_H
0002 #  error "this header file must not be included directly"
0003 #endif
0004 
0005 typedef struct {
0006     double real;
0007     double imag;
0008 } Py_complex;
0009 
0010 /* Operations on complex numbers from complexmodule.c */
0011 
0012 PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex);
0013 PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex);
0014 PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex);
0015 PyAPI_FUNC(Py_complex) _Py_c_prod(Py_complex, Py_complex);
0016 PyAPI_FUNC(Py_complex) _Py_c_quot(Py_complex, Py_complex);
0017 PyAPI_FUNC(Py_complex) _Py_c_pow(Py_complex, Py_complex);
0018 PyAPI_FUNC(double) _Py_c_abs(Py_complex);
0019 
0020 /* Complex object interface */
0021 
0022 /*
0023 PyComplexObject represents a complex number with double-precision
0024 real and imaginary parts.
0025 */
0026 typedef struct {
0027     PyObject_HEAD
0028     Py_complex cval;
0029 } PyComplexObject;
0030 
0031 PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
0032 
0033 PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);
0034 
0035 #ifdef Py_BUILD_CORE
0036 /* Format the object based on the format_spec, as defined in PEP 3101
0037    (Advanced String Formatting). */
0038 extern int _PyComplex_FormatAdvancedWriter(
0039     _PyUnicodeWriter *writer,
0040     PyObject *obj,
0041     PyObject *format_spec,
0042     Py_ssize_t start,
0043     Py_ssize_t end);
0044 #endif  // Py_BUILD_CORE