Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / src / nas,5.n2.os.2 / lib / python / include / python2.4 / complexobject.h
CommitLineData
86530b38
AT
1#ifndef Py_COMPLEXOBJECT_H
2#define Py_COMPLEXOBJECT_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7typedef struct {
8 double real;
9 double imag;
10} Py_complex;
11
12/* Operations on complex numbers from complexmodule.c */
13
14#define c_sum _Py_c_sum
15#define c_diff _Py_c_diff
16#define c_neg _Py_c_neg
17#define c_prod _Py_c_prod
18#define c_quot _Py_c_quot
19#define c_pow _Py_c_pow
20
21PyAPI_FUNC(Py_complex) c_sum(Py_complex, Py_complex);
22PyAPI_FUNC(Py_complex) c_diff(Py_complex, Py_complex);
23PyAPI_FUNC(Py_complex) c_neg(Py_complex);
24PyAPI_FUNC(Py_complex) c_prod(Py_complex, Py_complex);
25PyAPI_FUNC(Py_complex) c_quot(Py_complex, Py_complex);
26PyAPI_FUNC(Py_complex) c_pow(Py_complex, Py_complex);
27
28
29/* Complex object interface */
30
31/*
32PyComplexObject represents a complex number with double-precision
33real and imaginary parts.
34*/
35
36typedef struct {
37 PyObject_HEAD
38 Py_complex cval;
39} PyComplexObject;
40
41PyAPI_DATA(PyTypeObject) PyComplex_Type;
42
43#define PyComplex_Check(op) PyObject_TypeCheck(op, &PyComplex_Type)
44#define PyComplex_CheckExact(op) ((op)->ob_type == &PyComplex_Type)
45
46PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
47PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag);
48
49PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op);
50PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op);
51PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);
52
53#ifdef __cplusplus
54}
55#endif
56#endif /* !Py_COMPLEXOBJECT_H */