2
2
#include "util.h"
3
3
4
4
5
- static PyObject *
6
- complex_check (PyObject * Py_UNUSED (module ), PyObject * obj )
7
- {
8
- NULLABLE (obj );
9
- return PyLong_FromLong (PyComplex_Check (obj ));
10
- }
11
-
12
- static PyObject *
13
- complex_checkexact (PyObject * Py_UNUSED (module ), PyObject * obj )
14
- {
15
- NULLABLE (obj );
16
- return PyLong_FromLong (PyComplex_CheckExact (obj ));
17
- }
18
-
19
5
static PyObject *
20
6
complex_fromccomplex (PyObject * Py_UNUSED (module ), PyObject * obj )
21
7
{
@@ -28,48 +14,6 @@ complex_fromccomplex(PyObject *Py_UNUSED(module), PyObject *obj)
28
14
return PyComplex_FromCComplex (complex );
29
15
}
30
16
31
- static PyObject *
32
- complex_fromdoubles (PyObject * Py_UNUSED (module ), PyObject * args )
33
- {
34
- double real , imag ;
35
-
36
- if (!PyArg_ParseTuple (args , "dd" , & real , & imag )) {
37
- return NULL ;
38
- }
39
-
40
- return PyComplex_FromDoubles (real , imag );
41
- }
42
-
43
- static PyObject *
44
- complex_realasdouble (PyObject * Py_UNUSED (module ), PyObject * obj )
45
- {
46
- double real ;
47
-
48
- NULLABLE (obj );
49
- real = PyComplex_RealAsDouble (obj );
50
-
51
- if (real == -1. && PyErr_Occurred ()) {
52
- return NULL ;
53
- }
54
-
55
- return PyFloat_FromDouble (real );
56
- }
57
-
58
- static PyObject *
59
- complex_imagasdouble (PyObject * Py_UNUSED (module ), PyObject * obj )
60
- {
61
- double imag ;
62
-
63
- NULLABLE (obj );
64
- imag = PyComplex_ImagAsDouble (obj );
65
-
66
- if (imag == -1. && PyErr_Occurred ()) {
67
- return NULL ;
68
- }
69
-
70
- return PyFloat_FromDouble (imag );
71
- }
72
-
73
17
static PyObject *
74
18
complex_asccomplex (PyObject * Py_UNUSED (module ), PyObject * obj )
75
19
{
@@ -139,12 +83,7 @@ _py_c_abs(PyObject *Py_UNUSED(module), PyObject* obj)
139
83
140
84
141
85
static PyMethodDef test_methods [] = {
142
- {"complex_check" , complex_check , METH_O },
143
- {"complex_checkexact" , complex_checkexact , METH_O },
144
86
{"complex_fromccomplex" , complex_fromccomplex , METH_O },
145
- {"complex_fromdoubles" , complex_fromdoubles , METH_VARARGS },
146
- {"complex_realasdouble" , complex_realasdouble , METH_O },
147
- {"complex_imagasdouble" , complex_imagasdouble , METH_O },
148
87
{"complex_asccomplex" , complex_asccomplex , METH_O },
149
88
{"_py_c_sum" , _py_c_sum , METH_VARARGS },
150
89
{"_py_c_diff" , _py_c_diff , METH_VARARGS },
0 commit comments