vidya7732/AI_Doctor_LLM_GenModel
0
1/* Complex number structure */2 3#ifndef Py_COMPLEXOBJECT_H4#define Py_COMPLEXOBJECT_H5#ifdef __cplusplus6extern "C" {7#endif8 9#ifndef Py_LIMITED_API10typedef struct {11 double real;12 double imag;13} Py_complex;14 15/* Operations on complex numbers from complexmodule.c */16 17PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex);18PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex);19PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex);20PyAPI_FUNC(Py_complex) _Py_c_prod(Py_complex, Py_complex);21PyAPI_FUNC(Py_complex) _Py_c_quot(Py_complex, Py_complex);22PyAPI_FUNC(Py_complex) _Py_c_pow(Py_complex, Py_complex);23PyAPI_FUNC(double) _Py_c_abs(Py_complex);24#endif25 26/* Complex object interface */27 28/*29PyComplexObject represents a complex number with double-precision30real and imaginary parts.31*/32#ifndef Py_LIMITED_API33typedef struct {34 PyObject_HEAD35 Py_complex cval;36} PyComplexObject;37#endif38 39PyAPI_DATA(PyTypeObject) PyComplex_Type;40 41#define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)42#define PyComplex_CheckExact(op) Py_IS_TYPE(op, &PyComplex_Type)43 44#ifndef Py_LIMITED_API45PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);46#endif47PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag);48 49PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op);50PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op);51#ifndef Py_LIMITED_API52PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);53#endif54 55/* Format the object based on the format_spec, as defined in PEP 310156 (Advanced String Formatting). */57#ifndef Py_LIMITED_API58PyAPI_FUNC(int) _PyComplex_FormatAdvancedWriter(59 _PyUnicodeWriter *writer,60 PyObject *obj,61 PyObject *format_spec,62 Py_ssize_t start,63 Py_ssize_t end);64#endif65 66#ifdef __cplusplus67}68#endif69#endif /* !Py_COMPLEXOBJECT_H */70 