FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python/Include/complexobject.h at master · fruitegg/python · GitHub
fruitegg
/
python
Public
forked from
glix/python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python
/
Include
/
complexobject.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
60 lines (46 loc) · 1.5 KB
Breadcrumbs
python
/
Include
/
complexobject.h
Copy path
File metadata and controls
60 lines (46 loc) · 1.5 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* Complex number structure */
#ifndef
Py_COMPLEXOBJECT_H
#define
Py_COMPLEXOBJECT_H
#ifdef
__cplusplus
extern
"C"
{
#endif
typedef
struct
{
double
real
;
double
imag
;
}
Py_complex
;
/* Operations on complex numbers from complexmodule.c */
#define
c_sum
_Py_c_sum
#define
c_diff
_Py_c_diff
#define
c_neg
_Py_c_neg
#define
c_prod
_Py_c_prod
#define
c_quot
_Py_c_quot
#define
c_pow
_Py_c_pow
#define
c_abs
_Py_c_abs
PyAPI_FUNC
(
Py_complex
)
c_sum
(
Py_complex
,
Py_complex
);
PyAPI_FUNC
(
Py_complex
)
c_diff
(
Py_complex
,
Py_complex
);
PyAPI_FUNC
(
Py_complex
)
c_neg
(
Py_complex
);
PyAPI_FUNC
(
Py_complex
)
c_prod
(
Py_complex
,
Py_complex
);
PyAPI_FUNC
(
Py_complex
)
c_quot
(
Py_complex
,
Py_complex
);
PyAPI_FUNC
(
Py_complex
)
c_pow
(
Py_complex
,
Py_complex
);
PyAPI_FUNC
(
double
)
c_abs
(
Py_complex
);
/* Complex object interface */
/*
PyComplexObject represents a complex number with double-precision
real and imaginary parts.
*/
typedef
struct
{
PyObject_HEAD
Py_complex
cval
;
}
PyComplexObject
;
PyAPI_DATA
(
PyTypeObject
)
PyComplex_Type
;
#define
PyComplex_Check
(
op
) PyObject_TypeCheck(op, &PyComplex_Type)
#define
PyComplex_CheckExact
(
op
) (Py_TYPE(op) == &PyComplex_Type)
PyAPI_FUNC
(
PyObject
*
)
PyComplex_FromCComplex
(
Py_complex
);
PyAPI_FUNC
(
PyObject
*
)
PyComplex_FromDoubles
(
double
real
,
double
imag
);
PyAPI_FUNC
(
double
)
PyComplex_RealAsDouble
(
PyObject
*
op
);
PyAPI_FUNC
(
double
)
PyComplex_ImagAsDouble
(
PyObject
*
op
);
PyAPI_FUNC
(
Py_complex
)
PyComplex_AsCComplex
(
PyObject
*
op
);
#ifdef
__cplusplus
}
#endif
#endif
/* !Py_COMPLEXOBJECT_H */
Back
|
FazBrowse Home
|
New Git URL