line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
#ifdef __MINGW32__ |
3
|
|
|
|
|
|
|
#ifndef __USE_MINGW_ANSI_STDIO |
4
|
|
|
|
|
|
|
#define __USE_MINGW_ANSI_STDIO 1 |
5
|
|
|
|
|
|
|
#endif |
6
|
|
|
|
|
|
|
#endif |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#define PERL_NO_GET_CONTEXT 1 |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
#include "EXTERN.h" |
11
|
|
|
|
|
|
|
#include "perl.h" |
12
|
|
|
|
|
|
|
#include "XSUB.h" |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#include "math_complex_c_include.h" |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#define MATH_COMPLEX double _Complex |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#ifdef USE_CPOWL |
20
|
|
|
|
|
|
|
#define MY_CPOW (MATH_COMPLEX)cpowl |
21
|
|
|
|
|
|
|
#else |
22
|
|
|
|
|
|
|
#define MY_CPOW cpow |
23
|
|
|
|
|
|
|
#endif |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
int nnum = 0; |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
|
|
|
void d_set_prec(pTHX_ int x) { |
28
|
2
|
50
|
|
|
|
|
if(x < 1)croak("1st arg (precision) to d_set_prec must be at least 1"); |
29
|
2
|
|
|
|
|
|
_MATH_COMPLEX_C_DIGITS = x; |
30
|
2
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
8
|
|
|
|
|
|
int d_get_prec(void) { |
33
|
8
|
|
|
|
|
|
return _MATH_COMPLEX_C_DIGITS; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
62
|
|
|
|
|
|
int _is_nan(double x) { |
37
|
62
|
100
|
|
|
|
|
if(x == x) return 0; |
38
|
28
|
|
|
|
|
|
return 1; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
26
|
|
|
|
|
|
int _is_inf(double x) { |
42
|
26
|
50
|
|
|
|
|
if(x == 0) return 0; |
43
|
26
|
100
|
|
|
|
|
if(_is_nan(x)) return 0; |
44
|
18
|
100
|
|
|
|
|
if(x / x == x / x) return 0; |
45
|
8
|
100
|
|
|
|
|
if(x < 0) return -1; |
46
|
4
|
|
|
|
|
|
return 1; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
148
|
|
|
|
|
|
double _get_nan(void) { |
50
|
148
|
|
|
|
|
|
double nanval = 0.0 / 0.0; |
51
|
148
|
|
|
|
|
|
return nanval; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
2
|
|
|
|
|
|
double _get_inf(void) { |
55
|
2
|
|
|
|
|
|
double infval = 1.0 / 0.0; |
56
|
2
|
|
|
|
|
|
return infval; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
double _get_neg_inf(void) { |
60
|
0
|
|
|
|
|
|
double inf = -1.0 / 0.0; |
61
|
0
|
|
|
|
|
|
return inf; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
72
|
|
|
|
|
|
SV * create_c(pTHX) { |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
MATH_COMPLEX *pc; |
67
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
68
|
|
|
|
|
|
|
|
69
|
72
|
|
|
|
|
|
New(42, pc, 1, MATH_COMPLEX); |
70
|
72
|
50
|
|
|
|
|
if(pc == NULL) croak("Failed to allocate memory in create_c function"); |
71
|
|
|
|
|
|
|
|
72
|
72
|
|
|
|
|
|
obj_ref = newSV(0); |
73
|
72
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Complex_C"); |
74
|
|
|
|
|
|
|
|
75
|
72
|
|
|
|
|
|
__real__ *pc = _get_nan(); |
76
|
72
|
|
|
|
|
|
__imag__ *pc = _get_nan(); |
77
|
|
|
|
|
|
|
|
78
|
72
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,pc)); |
79
|
72
|
|
|
|
|
|
SvREADONLY_on(obj); |
80
|
72
|
|
|
|
|
|
return obj_ref; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
76
|
|
|
|
|
|
void assign_c(pTHX_ SV * rop, SV * d1, SV * d2) { |
85
|
|
|
|
|
|
|
double _d1, _d2; |
86
|
|
|
|
|
|
|
|
87
|
76
|
50
|
|
|
|
|
if(SvUOK(d1)) { |
88
|
0
|
|
|
|
|
|
_d1 = (double)SvUVX(d1); |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
else { |
91
|
76
|
100
|
|
|
|
|
if(SvIOK(d1)) { |
92
|
36
|
|
|
|
|
|
_d1 = (double)SvIVX(d1); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
else { |
95
|
40
|
100
|
|
|
|
|
if(SvNOK(d1)) { |
96
|
28
|
|
|
|
|
|
_d1 = (double)SvNVX(d1); |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
else { |
99
|
12
|
50
|
|
|
|
|
if(SvPOK(d1)) { |
100
|
12
|
100
|
|
|
|
|
if(!looks_like_number(d1)) nnum++; |
101
|
12
|
50
|
|
|
|
|
_d1 = strtod(SvPV_nolen(d1), NULL); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
else { |
104
|
0
|
|
|
|
|
|
croak("Invalid 2nd arg supplied to assign_c function"); |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
76
|
50
|
|
|
|
|
if(SvUOK(d2)) { |
111
|
0
|
|
|
|
|
|
_d2 = (double)SvUVX(d2); |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
else { |
114
|
76
|
100
|
|
|
|
|
if(SvIOK(d2)) { |
115
|
31
|
|
|
|
|
|
_d2 = (double)SvIVX(d2); |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
else { |
118
|
45
|
100
|
|
|
|
|
if(SvNOK(d2)) { |
119
|
34
|
|
|
|
|
|
_d2 = (double)SvNVX(d2); |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
else { |
122
|
11
|
50
|
|
|
|
|
if(SvPOK(d2)) { |
123
|
11
|
100
|
|
|
|
|
if(!looks_like_number(d2)) nnum++; |
124
|
11
|
50
|
|
|
|
|
_d2 = strtod(SvPV_nolen(d2), NULL) ; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
else { |
127
|
0
|
|
|
|
|
|
croak("Invalid 3rd arg supplied to assign_c function"); |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
76
|
|
|
|
|
|
__real__ *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = _d1; |
134
|
76
|
|
|
|
|
|
__imag__ *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = _d2; |
135
|
76
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
|
137
|
4
|
|
|
|
|
|
void set_real_c(pTHX_ SV * rop, SV * d1) { |
138
|
|
|
|
|
|
|
double _d1; |
139
|
|
|
|
|
|
|
|
140
|
4
|
100
|
|
|
|
|
if(SvUOK(d1)) { |
141
|
1
|
|
|
|
|
|
_d1 = (double)SvUVX(d1); |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
else { |
144
|
3
|
50
|
|
|
|
|
if(SvIOK(d1)) { |
145
|
0
|
|
|
|
|
|
_d1 = (double)SvIVX(d1); |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
else { |
148
|
3
|
100
|
|
|
|
|
if(SvNOK(d1)) { |
149
|
2
|
|
|
|
|
|
_d1 = (double)SvNVX(d1); |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
else { |
152
|
1
|
50
|
|
|
|
|
if(SvPOK(d1)) { |
153
|
1
|
50
|
|
|
|
|
if(!looks_like_number(d1)) nnum++; |
154
|
1
|
50
|
|
|
|
|
_d1 = strtod(SvPV_nolen(d1), NULL) ; |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
else { |
157
|
0
|
|
|
|
|
|
croak("Invalid 2nd arg supplied to set_real_c function"); |
158
|
|
|
|
|
|
|
} |
159
|
|
|
|
|
|
|
} |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
} |
162
|
|
|
|
|
|
|
|
163
|
4
|
|
|
|
|
|
__real__ *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = _d1; |
164
|
4
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
4
|
|
|
|
|
|
void set_imag_c(pTHX_ SV * rop, SV * d2) { |
167
|
|
|
|
|
|
|
double _d2; |
168
|
|
|
|
|
|
|
|
169
|
4
|
50
|
|
|
|
|
if(SvUOK(d2)) { |
170
|
0
|
|
|
|
|
|
_d2 = (double)SvUVX(d2); |
171
|
|
|
|
|
|
|
} |
172
|
|
|
|
|
|
|
else { |
173
|
4
|
100
|
|
|
|
|
if(SvIOK(d2)) { |
174
|
3
|
|
|
|
|
|
_d2 = (double)SvIVX(d2); |
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
else { |
177
|
1
|
50
|
|
|
|
|
if(SvNOK(d2)) { |
178
|
0
|
|
|
|
|
|
_d2 = (double)SvNVX(d2); |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
else { |
181
|
1
|
50
|
|
|
|
|
if(SvPOK(d2)) { |
182
|
1
|
50
|
|
|
|
|
if(!looks_like_number(d2)) nnum++; |
183
|
1
|
50
|
|
|
|
|
_d2 = strtod(SvPV_nolen(d2), NULL) ; |
184
|
|
|
|
|
|
|
} |
185
|
|
|
|
|
|
|
else { |
186
|
0
|
|
|
|
|
|
croak("Invalid 2nd arg supplied to set_imag_c function"); |
187
|
|
|
|
|
|
|
} |
188
|
|
|
|
|
|
|
} |
189
|
|
|
|
|
|
|
} |
190
|
|
|
|
|
|
|
} |
191
|
|
|
|
|
|
|
|
192
|
4
|
|
|
|
|
|
__imag__ *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = _d2; |
193
|
4
|
|
|
|
|
|
} |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
|
196
|
1
|
|
|
|
|
|
void mul_c(pTHX_ SV * rop, SV * op1, SV * op2) { |
197
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) * |
198
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op2)))); |
199
|
1
|
|
|
|
|
|
} |
200
|
|
|
|
|
|
|
|
201
|
1
|
|
|
|
|
|
void mul_c_nv(pTHX_ SV * rop, SV * op1, SV * op2) { |
202
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) * |
203
|
1
|
50
|
|
|
|
|
(double)SvNV(op2); |
204
|
1
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
|
206
|
1
|
|
|
|
|
|
void mul_c_iv(pTHX_ SV * rop, SV * op1, SV * op2) { |
207
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) * |
208
|
1
|
50
|
|
|
|
|
(double)SvIV(op2); |
209
|
1
|
|
|
|
|
|
} |
210
|
|
|
|
|
|
|
|
211
|
1
|
|
|
|
|
|
void mul_c_uv(pTHX_ SV * rop, SV * op1, SV * op2) { |
212
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) * |
213
|
1
|
50
|
|
|
|
|
(double)SvUV(op2); |
214
|
1
|
|
|
|
|
|
} |
215
|
|
|
|
|
|
|
|
216
|
1
|
|
|
|
|
|
void mul_c_pv(pTHX_ SV * rop, SV * op1, SV * op2) { |
217
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) * |
218
|
1
|
50
|
|
|
|
|
strtod(SvPV_nolen(op2), NULL); |
219
|
1
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
|
221
|
1
|
|
|
|
|
|
void div_c(pTHX_ SV * rop, SV * op1, SV * op2) { |
222
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) / |
223
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op2)))); |
224
|
1
|
|
|
|
|
|
} |
225
|
|
|
|
|
|
|
|
226
|
1
|
|
|
|
|
|
void div_c_nv(pTHX_ SV * rop, SV * op1, SV * op2) { |
227
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) / |
228
|
1
|
50
|
|
|
|
|
(double)SvNV(op2); |
229
|
1
|
|
|
|
|
|
} |
230
|
|
|
|
|
|
|
|
231
|
1
|
|
|
|
|
|
void div_c_iv(pTHX_ SV * rop, SV * op1, SV * op2) { |
232
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) / |
233
|
1
|
50
|
|
|
|
|
(double)SvIV(op2); |
234
|
1
|
|
|
|
|
|
} |
235
|
|
|
|
|
|
|
|
236
|
1
|
|
|
|
|
|
void div_c_uv(pTHX_ SV * rop, SV * op1, SV * op2) { |
237
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) / |
238
|
1
|
50
|
|
|
|
|
(double)SvUV(op2); |
239
|
1
|
|
|
|
|
|
} |
240
|
|
|
|
|
|
|
|
241
|
1
|
|
|
|
|
|
void div_c_pv(pTHX_ SV * rop, SV * op1, SV * op2) { |
242
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) / |
243
|
1
|
50
|
|
|
|
|
strtod(SvPV_nolen(op2), NULL); |
244
|
1
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
|
246
|
1
|
|
|
|
|
|
void add_c(pTHX_ SV * rop, SV * op1, SV * op2) { |
247
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) + |
248
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op2)))); |
249
|
1
|
|
|
|
|
|
} |
250
|
|
|
|
|
|
|
|
251
|
1
|
|
|
|
|
|
void add_c_nv(pTHX_ SV * rop, SV * op1, SV * op2) { |
252
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) + |
253
|
1
|
50
|
|
|
|
|
(double)SvNV(op2); |
254
|
1
|
|
|
|
|
|
} |
255
|
|
|
|
|
|
|
|
256
|
1
|
|
|
|
|
|
void add_c_iv(pTHX_ SV * rop, SV * op1, SV * op2) { |
257
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) + |
258
|
1
|
50
|
|
|
|
|
(double)SvIV(op2); |
259
|
1
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
|
261
|
1
|
|
|
|
|
|
void add_c_uv(pTHX_ SV * rop, SV * op1, SV * op2) { |
262
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) + |
263
|
1
|
50
|
|
|
|
|
(double)SvUV(op2); |
264
|
1
|
|
|
|
|
|
} |
265
|
|
|
|
|
|
|
|
266
|
1
|
|
|
|
|
|
void add_c_pv(pTHX_ SV * rop, SV * op1, SV * op2) { |
267
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) + |
268
|
1
|
50
|
|
|
|
|
strtod(SvPV_nolen(op2), NULL); |
269
|
1
|
|
|
|
|
|
} |
270
|
|
|
|
|
|
|
|
271
|
1
|
|
|
|
|
|
void sub_c(pTHX_ SV * rop, SV * op1, SV * op2) { |
272
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) - |
273
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op2)))); |
274
|
1
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
|
276
|
1
|
|
|
|
|
|
void sub_c_nv(pTHX_ SV * rop, SV * op1, SV * op2) { |
277
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) - |
278
|
1
|
50
|
|
|
|
|
(double)SvNV(op2); |
279
|
1
|
|
|
|
|
|
} |
280
|
|
|
|
|
|
|
|
281
|
1
|
|
|
|
|
|
void sub_c_iv(pTHX_ SV * rop, SV * op1, SV * op2) { |
282
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) - |
283
|
1
|
50
|
|
|
|
|
(double)SvIV(op2); |
284
|
1
|
|
|
|
|
|
} |
285
|
|
|
|
|
|
|
|
286
|
1
|
|
|
|
|
|
void sub_c_uv(pTHX_ SV * rop, SV * op1, SV * op2) { |
287
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) - |
288
|
1
|
50
|
|
|
|
|
(double)SvUV(op2); |
289
|
1
|
|
|
|
|
|
} |
290
|
|
|
|
|
|
|
|
291
|
1
|
|
|
|
|
|
void sub_c_pv(pTHX_ SV * rop, SV * op1, SV * op2) { |
292
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op1)))) - |
293
|
1
|
50
|
|
|
|
|
strtod(SvPV_nolen(op2), NULL); |
294
|
1
|
|
|
|
|
|
} |
295
|
|
|
|
|
|
|
|
296
|
126
|
|
|
|
|
|
void DESTROY(pTHX_ SV * op) { |
297
|
126
|
|
|
|
|
|
Safefree(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op)))); |
298
|
126
|
|
|
|
|
|
} |
299
|
|
|
|
|
|
|
|
300
|
78
|
|
|
|
|
|
SV * real_c(pTHX_ SV * op) { |
301
|
78
|
|
|
|
|
|
return newSVnv(creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op)))))); |
302
|
|
|
|
|
|
|
} |
303
|
|
|
|
|
|
|
|
304
|
58
|
|
|
|
|
|
SV * imag_c(pTHX_ SV * op) { |
305
|
58
|
|
|
|
|
|
return newSVnv(cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op)))))); |
306
|
|
|
|
|
|
|
} |
307
|
|
|
|
|
|
|
|
308
|
1
|
|
|
|
|
|
SV * arg_c(pTHX_ SV * op) { |
309
|
1
|
|
|
|
|
|
return newSVnv(carg(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op)))))); |
310
|
|
|
|
|
|
|
} |
311
|
|
|
|
|
|
|
|
312
|
1
|
|
|
|
|
|
SV * abs_c(pTHX_ SV * op) { |
313
|
1
|
|
|
|
|
|
return newSVnv(cabs(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op)))))); |
314
|
|
|
|
|
|
|
} |
315
|
|
|
|
|
|
|
|
316
|
1
|
|
|
|
|
|
void conj_c(pTHX_ SV * rop, SV * op) { |
317
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = conj(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
318
|
1
|
|
|
|
|
|
} |
319
|
|
|
|
|
|
|
|
320
|
1
|
|
|
|
|
|
void acos_c(pTHX_ SV * rop, SV * op) { |
321
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = cacos(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
322
|
1
|
|
|
|
|
|
} |
323
|
|
|
|
|
|
|
|
324
|
1
|
|
|
|
|
|
void asin_c(pTHX_ SV * rop, SV * op) { |
325
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = casin(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
326
|
1
|
|
|
|
|
|
} |
327
|
|
|
|
|
|
|
|
328
|
1
|
|
|
|
|
|
void atan_c(pTHX_ SV * rop, SV * op) { |
329
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = catan(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
330
|
1
|
|
|
|
|
|
} |
331
|
|
|
|
|
|
|
|
332
|
1
|
|
|
|
|
|
void cos_c(pTHX_ SV * rop, SV * op) { |
333
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = ccos(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
334
|
1
|
|
|
|
|
|
} |
335
|
|
|
|
|
|
|
|
336
|
1
|
|
|
|
|
|
void sin_c(pTHX_ SV * rop, SV * op) { |
337
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = csin(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
338
|
1
|
|
|
|
|
|
} |
339
|
|
|
|
|
|
|
|
340
|
1
|
|
|
|
|
|
void tan_c(pTHX_ SV * rop, SV * op) { |
341
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = ctan(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
342
|
1
|
|
|
|
|
|
} |
343
|
|
|
|
|
|
|
|
344
|
1
|
|
|
|
|
|
void acosh_c(pTHX_ SV * rop, SV * op) { |
345
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = cacosh(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
346
|
1
|
|
|
|
|
|
} |
347
|
|
|
|
|
|
|
|
348
|
1
|
|
|
|
|
|
void asinh_c(pTHX_ SV * rop, SV * op) { |
349
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = casinh(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
350
|
1
|
|
|
|
|
|
} |
351
|
|
|
|
|
|
|
|
352
|
1
|
|
|
|
|
|
void atanh_c(pTHX_ SV * rop, SV * op) { |
353
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = catanh(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
354
|
1
|
|
|
|
|
|
} |
355
|
|
|
|
|
|
|
|
356
|
1
|
|
|
|
|
|
void cosh_c(pTHX_ SV * rop, SV * op) { |
357
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = ccosh(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
358
|
1
|
|
|
|
|
|
} |
359
|
|
|
|
|
|
|
|
360
|
1
|
|
|
|
|
|
void sinh_c(pTHX_ SV * rop, SV * op) { |
361
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = csinh(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
362
|
1
|
|
|
|
|
|
} |
363
|
|
|
|
|
|
|
|
364
|
1
|
|
|
|
|
|
void tanh_c(pTHX_ SV * rop, SV * op) { |
365
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = ctanh(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
366
|
1
|
|
|
|
|
|
} |
367
|
|
|
|
|
|
|
|
368
|
1
|
|
|
|
|
|
void exp_c(pTHX_ SV * rop, SV * op) { |
369
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = cexp(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
370
|
1
|
|
|
|
|
|
} |
371
|
|
|
|
|
|
|
|
372
|
1
|
|
|
|
|
|
void log_c(pTHX_ SV * rop, SV * op) { |
373
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = clog(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
374
|
1
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
|
376
|
1
|
|
|
|
|
|
void sqrt_c(pTHX_ SV * rop, SV * op) { |
377
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = csqrt(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
378
|
1
|
|
|
|
|
|
} |
379
|
|
|
|
|
|
|
|
380
|
6
|
|
|
|
|
|
void proj_c(pTHX_ SV * rop, SV * op) { |
381
|
6
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = cproj(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op))))); |
382
|
6
|
|
|
|
|
|
} |
383
|
|
|
|
|
|
|
|
384
|
1
|
|
|
|
|
|
void pow_c(pTHX_ SV * rop, SV * op, SV * exp) { |
385
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))) = MY_CPOW(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(op)))), |
386
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(exp))))); |
387
|
1
|
|
|
|
|
|
} |
388
|
|
|
|
|
|
|
|
389
|
4
|
|
|
|
|
|
SV * _overload_true(pTHX_ SV * rop, SV * second, SV * third) { |
390
|
6
|
|
|
|
|
|
if (_is_nan(creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))))) && |
391
|
4
|
|
|
|
|
|
_is_nan(cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop))))))) return newSVuv(0); |
392
|
2
|
50
|
|
|
|
|
if(creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop))))) || |
|
|
0
|
|
|
|
|
|
393
|
2
|
|
|
|
|
|
cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))))) return newSVuv(1); |
394
|
0
|
|
|
|
|
|
return newSVuv(0); |
395
|
|
|
|
|
|
|
} |
396
|
|
|
|
|
|
|
|
397
|
8
|
|
|
|
|
|
SV * _overload_not(pTHX_ SV * rop, SV * second, SV * third) { |
398
|
12
|
|
|
|
|
|
if (_is_nan(creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))))) && |
399
|
8
|
|
|
|
|
|
_is_nan(cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop))))))) return newSVuv(1); |
400
|
4
|
50
|
|
|
|
|
if(creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop))))) || |
|
|
0
|
|
|
|
|
|
401
|
4
|
|
|
|
|
|
cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))))) return newSVuv(0); |
402
|
0
|
|
|
|
|
|
return newSVuv(1); |
403
|
|
|
|
|
|
|
} |
404
|
|
|
|
|
|
|
|
405
|
41
|
|
|
|
|
|
SV * _overload_equiv(pTHX_ SV * a, SV * b, SV * third) { |
406
|
41
|
100
|
|
|
|
|
if(SvUOK(b)) { |
407
|
1
|
50
|
|
|
|
|
if((double)SvUVX(b) == creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))) && |
|
|
50
|
|
|
|
|
|
408
|
1
|
|
|
|
|
|
0.0 == cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))))) return newSVuv(1); |
409
|
0
|
|
|
|
|
|
return newSVuv(0); |
410
|
|
|
|
|
|
|
} |
411
|
40
|
100
|
|
|
|
|
if(SvIOK(b)) { |
412
|
4
|
50
|
|
|
|
|
if((double)SvIVX(b) == creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))) && |
|
|
50
|
|
|
|
|
|
413
|
4
|
|
|
|
|
|
0.0 == cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))))) return newSVuv(1); |
414
|
0
|
|
|
|
|
|
return newSVuv(0); |
415
|
|
|
|
|
|
|
} |
416
|
36
|
50
|
|
|
|
|
if(SvNOK(b)) { |
417
|
0
|
0
|
|
|
|
|
if((double)SvNVX(b) == creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))) && |
|
|
0
|
|
|
|
|
|
418
|
0
|
|
|
|
|
|
0.0 == cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))))) return newSVuv(1); |
419
|
0
|
|
|
|
|
|
return newSVuv(0); |
420
|
|
|
|
|
|
|
} |
421
|
|
|
|
|
|
|
|
422
|
36
|
100
|
|
|
|
|
if(SvPOK(b)) { |
423
|
2
|
50
|
|
|
|
|
if(!looks_like_number(b)) nnum++; |
424
|
2
|
50
|
|
|
|
|
if(strtod(SvPV_nolen(b), NULL) == creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))) && |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
425
|
1
|
|
|
|
|
|
0.0 == cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))))) return newSVuv(1); |
426
|
1
|
|
|
|
|
|
return newSVuv(0); |
427
|
|
|
|
|
|
|
} |
428
|
|
|
|
|
|
|
|
429
|
34
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
430
|
34
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
431
|
34
|
50
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) { |
432
|
34
|
50
|
|
|
|
|
if(creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))) == creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b))))) && |
|
|
50
|
|
|
|
|
|
433
|
34
|
|
|
|
|
|
cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))) == cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b)))))) |
434
|
34
|
|
|
|
|
|
return newSVuv(1); |
435
|
0
|
|
|
|
|
|
return newSVuv(0); |
436
|
|
|
|
|
|
|
} |
437
|
|
|
|
|
|
|
} |
438
|
|
|
|
|
|
|
|
439
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Complex_C::_overload_equiv function"); |
440
|
|
|
|
|
|
|
} |
441
|
|
|
|
|
|
|
|
442
|
5
|
|
|
|
|
|
SV * _overload_not_equiv(pTHX_ SV * a, SV * b, SV * third) { |
443
|
5
|
50
|
|
|
|
|
if(SvUOK(b)) { |
444
|
0
|
0
|
|
|
|
|
if((double)SvUVX(b) == creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))) && |
|
|
0
|
|
|
|
|
|
445
|
0
|
|
|
|
|
|
0.0 == cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))))) return newSVuv(0); |
446
|
0
|
|
|
|
|
|
return newSVuv(1); |
447
|
|
|
|
|
|
|
} |
448
|
5
|
50
|
|
|
|
|
if(SvIOK(b)) { |
449
|
0
|
0
|
|
|
|
|
if((double)SvIVX(b) == creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))) && |
|
|
0
|
|
|
|
|
|
450
|
0
|
|
|
|
|
|
0.0 == cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))))) return newSVuv(0); |
451
|
0
|
|
|
|
|
|
return newSVuv(1); |
452
|
|
|
|
|
|
|
} |
453
|
5
|
50
|
|
|
|
|
if(SvNOK(b)) { |
454
|
0
|
0
|
|
|
|
|
if((double)SvNVX(b) == creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))) && |
|
|
0
|
|
|
|
|
|
455
|
0
|
|
|
|
|
|
0.0 == cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))))) return newSVuv(0); |
456
|
0
|
|
|
|
|
|
return newSVuv(1); |
457
|
|
|
|
|
|
|
} |
458
|
5
|
100
|
|
|
|
|
if(SvPOK(b)) { |
459
|
2
|
50
|
|
|
|
|
if(!looks_like_number(b)) nnum++; |
460
|
2
|
50
|
|
|
|
|
if(strtod(SvPV_nolen(b), NULL) == creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))) && |
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
461
|
1
|
|
|
|
|
|
0.0 == cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))))) return newSVuv(0); |
462
|
1
|
|
|
|
|
|
return newSVuv(1); |
463
|
|
|
|
|
|
|
} |
464
|
3
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
465
|
3
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
466
|
3
|
50
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) { |
467
|
3
|
50
|
|
|
|
|
if(creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))) == creal(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b))))) && |
|
|
0
|
|
|
|
|
|
468
|
0
|
|
|
|
|
|
cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))) == cimag(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b)))))) |
469
|
0
|
|
|
|
|
|
return newSVuv(0); |
470
|
3
|
|
|
|
|
|
return newSVuv(1); |
471
|
|
|
|
|
|
|
} |
472
|
|
|
|
|
|
|
} |
473
|
|
|
|
|
|
|
|
474
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Complex_C::_overload_not_equiv function"); |
475
|
|
|
|
|
|
|
} |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
|
478
|
17
|
|
|
|
|
|
SV * _overload_pow(pTHX_ SV * a, SV * b, SV * third) { |
479
|
|
|
|
|
|
|
MATH_COMPLEX *pc, t; |
480
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
481
|
|
|
|
|
|
|
|
482
|
17
|
|
|
|
|
|
New(42, pc, 1, MATH_COMPLEX); |
483
|
17
|
50
|
|
|
|
|
if(pc == NULL) croak("Failed to allocate memory in _overload_pow function"); |
484
|
|
|
|
|
|
|
|
485
|
17
|
|
|
|
|
|
obj_ref = newSV(0); |
486
|
17
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Complex_C"); |
487
|
|
|
|
|
|
|
|
488
|
17
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,pc)); |
489
|
17
|
|
|
|
|
|
SvREADONLY_on(obj); |
490
|
|
|
|
|
|
|
|
491
|
17
|
50
|
|
|
|
|
if(SvUOK(b)) { |
492
|
0
|
|
|
|
|
|
__real__ t = (double)SvUVX(b); |
493
|
0
|
|
|
|
|
|
__imag__ t = 0.0; |
494
|
0
|
0
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
495
|
0
|
|
|
|
|
|
*pc = MY_CPOW( t, *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) ); |
496
|
0
|
|
|
|
|
|
return obj_ref; |
497
|
|
|
|
|
|
|
} |
498
|
0
|
|
|
|
|
|
*pc = MY_CPOW(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))), t); |
499
|
0
|
|
|
|
|
|
return obj_ref; |
500
|
|
|
|
|
|
|
} |
501
|
|
|
|
|
|
|
|
502
|
17
|
100
|
|
|
|
|
if(SvIOK(b)) { |
503
|
9
|
|
|
|
|
|
__real__ t = (double)SvIVX(b); |
504
|
9
|
|
|
|
|
|
__imag__ t = 0.0; |
505
|
9
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
506
|
3
|
|
|
|
|
|
*pc = MY_CPOW( t, *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) ); |
507
|
3
|
|
|
|
|
|
return obj_ref; |
508
|
|
|
|
|
|
|
} |
509
|
6
|
|
|
|
|
|
*pc = MY_CPOW(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))), t); |
510
|
6
|
|
|
|
|
|
return obj_ref; |
511
|
|
|
|
|
|
|
} |
512
|
|
|
|
|
|
|
|
513
|
8
|
100
|
|
|
|
|
if(SvNOK(b)) { |
514
|
3
|
|
|
|
|
|
__real__ t = (double)SvNVX(b); |
515
|
3
|
|
|
|
|
|
__imag__ t = 0.0; |
516
|
3
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
517
|
1
|
|
|
|
|
|
*pc = MY_CPOW( t, *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) ); |
518
|
1
|
|
|
|
|
|
return obj_ref; |
519
|
|
|
|
|
|
|
} |
520
|
2
|
|
|
|
|
|
*pc = MY_CPOW(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))), t); |
521
|
2
|
|
|
|
|
|
return obj_ref; |
522
|
|
|
|
|
|
|
} |
523
|
|
|
|
|
|
|
|
524
|
5
|
100
|
|
|
|
|
if(SvPOK(b)) { |
525
|
2
|
50
|
|
|
|
|
if(!looks_like_number(b)) nnum++; |
526
|
2
|
50
|
|
|
|
|
__real__ t = strtod(SvPV_nolen(b), NULL); |
527
|
2
|
|
|
|
|
|
__imag__ t = 0.0; |
528
|
2
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
529
|
1
|
|
|
|
|
|
*pc = MY_CPOW( t, *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) ); |
530
|
1
|
|
|
|
|
|
return obj_ref; |
531
|
|
|
|
|
|
|
} |
532
|
1
|
|
|
|
|
|
*pc = MY_CPOW(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))), t); |
533
|
1
|
|
|
|
|
|
return obj_ref; |
534
|
|
|
|
|
|
|
} |
535
|
3
|
50
|
|
|
|
|
else if(sv_isobject(b)) { |
536
|
3
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
537
|
3
|
50
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) { |
538
|
3
|
|
|
|
|
|
*pc = MY_CPOW(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))), *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b))))); |
539
|
3
|
|
|
|
|
|
return obj_ref; |
540
|
|
|
|
|
|
|
} |
541
|
|
|
|
|
|
|
} |
542
|
0
|
|
|
|
|
|
else croak("Invalid argument supplied to Math::Complex_C::_overload_pow function"); |
543
|
0
|
|
|
|
|
|
} |
544
|
|
|
|
|
|
|
|
545
|
5
|
|
|
|
|
|
SV * _overload_mul(pTHX_ SV * a, SV * b, SV * third) { |
546
|
|
|
|
|
|
|
MATH_COMPLEX *pc; |
547
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
548
|
|
|
|
|
|
|
|
549
|
5
|
|
|
|
|
|
New(42, pc, 1, MATH_COMPLEX); |
550
|
5
|
50
|
|
|
|
|
if(pc == NULL) croak("Failed to allocate memory in _overload_mul function"); |
551
|
|
|
|
|
|
|
|
552
|
5
|
|
|
|
|
|
obj_ref = newSV(0); |
553
|
5
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Complex_C"); |
554
|
|
|
|
|
|
|
|
555
|
5
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,pc)); |
556
|
5
|
|
|
|
|
|
SvREADONLY_on(obj); |
557
|
|
|
|
|
|
|
|
558
|
5
|
50
|
|
|
|
|
if(SvUOK(b)) { |
559
|
0
|
|
|
|
|
|
*pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) * (double)SvUVX(b); |
560
|
0
|
|
|
|
|
|
return obj_ref; |
561
|
|
|
|
|
|
|
} |
562
|
|
|
|
|
|
|
|
563
|
5
|
100
|
|
|
|
|
if(SvIOK(b)) { |
564
|
2
|
|
|
|
|
|
*pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) * (double)SvIVX(b); |
565
|
2
|
|
|
|
|
|
return obj_ref; |
566
|
|
|
|
|
|
|
} |
567
|
|
|
|
|
|
|
|
568
|
3
|
100
|
|
|
|
|
if(SvNOK(b)) { |
569
|
1
|
|
|
|
|
|
*pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) * (double)SvNVX(b); |
570
|
1
|
|
|
|
|
|
return obj_ref; |
571
|
|
|
|
|
|
|
} |
572
|
2
|
100
|
|
|
|
|
if(SvPOK(b)) { |
573
|
1
|
50
|
|
|
|
|
if(!looks_like_number(b)) nnum++; |
574
|
1
|
50
|
|
|
|
|
*pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) * strtod(SvPV_nolen(b), NULL); |
575
|
1
|
|
|
|
|
|
return obj_ref; |
576
|
|
|
|
|
|
|
} |
577
|
1
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
578
|
1
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
579
|
1
|
50
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) { |
580
|
1
|
|
|
|
|
|
*pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) * *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b)))); |
581
|
1
|
|
|
|
|
|
return obj_ref; |
582
|
|
|
|
|
|
|
} |
583
|
|
|
|
|
|
|
} |
584
|
|
|
|
|
|
|
|
585
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Complex_C::_overload_mul function"); |
586
|
|
|
|
|
|
|
} |
587
|
|
|
|
|
|
|
|
588
|
5
|
|
|
|
|
|
SV * _overload_add(pTHX_ SV * a, SV * b, SV * third) { |
589
|
|
|
|
|
|
|
MATH_COMPLEX *pc; |
590
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
591
|
|
|
|
|
|
|
|
592
|
5
|
|
|
|
|
|
New(42, pc, 1, MATH_COMPLEX); |
593
|
5
|
50
|
|
|
|
|
if(pc == NULL) croak("Failed to allocate memory in _overload_add function"); |
594
|
|
|
|
|
|
|
|
595
|
5
|
|
|
|
|
|
obj_ref = newSV(0); |
596
|
5
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Complex_C"); |
597
|
|
|
|
|
|
|
|
598
|
5
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,pc)); |
599
|
5
|
|
|
|
|
|
SvREADONLY_on(obj); |
600
|
|
|
|
|
|
|
|
601
|
5
|
50
|
|
|
|
|
if(SvUOK(b)) { |
602
|
0
|
|
|
|
|
|
*pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) + (double)SvUVX(b); |
603
|
0
|
|
|
|
|
|
return obj_ref; |
604
|
|
|
|
|
|
|
} |
605
|
|
|
|
|
|
|
|
606
|
5
|
100
|
|
|
|
|
if(SvIOK(b)) { |
607
|
2
|
|
|
|
|
|
*pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) + (double)SvIVX(b); |
608
|
2
|
|
|
|
|
|
return obj_ref; |
609
|
|
|
|
|
|
|
} |
610
|
|
|
|
|
|
|
|
611
|
3
|
100
|
|
|
|
|
if(SvNOK(b)) { |
612
|
1
|
|
|
|
|
|
*pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) + (double)SvNVX(b); |
613
|
1
|
|
|
|
|
|
return obj_ref; |
614
|
|
|
|
|
|
|
} |
615
|
2
|
100
|
|
|
|
|
if(SvPOK(b)) { |
616
|
1
|
50
|
|
|
|
|
if(!looks_like_number(b)) nnum++; |
617
|
1
|
50
|
|
|
|
|
*pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) + strtod(SvPV_nolen(b), NULL); |
618
|
1
|
|
|
|
|
|
return obj_ref; |
619
|
|
|
|
|
|
|
} |
620
|
1
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
621
|
1
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
622
|
1
|
50
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) { |
623
|
1
|
|
|
|
|
|
*pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) + *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b)))); |
624
|
1
|
|
|
|
|
|
return obj_ref; |
625
|
|
|
|
|
|
|
} |
626
|
|
|
|
|
|
|
} |
627
|
|
|
|
|
|
|
|
628
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Complex_C::_overload_add function"); |
629
|
|
|
|
|
|
|
} |
630
|
|
|
|
|
|
|
|
631
|
9
|
|
|
|
|
|
SV * _overload_div(pTHX_ SV * a, SV * b, SV * third) { |
632
|
|
|
|
|
|
|
MATH_COMPLEX *pc; |
633
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
634
|
|
|
|
|
|
|
|
635
|
9
|
|
|
|
|
|
New(42, pc, 1, MATH_COMPLEX); |
636
|
9
|
50
|
|
|
|
|
if(pc == NULL) croak("Failed to allocate memory in _overload_div function"); |
637
|
|
|
|
|
|
|
|
638
|
9
|
|
|
|
|
|
obj_ref = newSV(0); |
639
|
9
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Complex_C"); |
640
|
|
|
|
|
|
|
|
641
|
9
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,pc)); |
642
|
9
|
|
|
|
|
|
SvREADONLY_on(obj); |
643
|
|
|
|
|
|
|
|
644
|
9
|
50
|
|
|
|
|
if(SvUOK(b)) { |
645
|
0
|
0
|
|
|
|
|
if(SWITCH_ARGS) *pc = (double)SvUVX(b) / *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
646
|
0
|
|
|
|
|
|
else *pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) / (double)SvUVX(b); |
647
|
0
|
|
|
|
|
|
return obj_ref; |
648
|
|
|
|
|
|
|
} |
649
|
|
|
|
|
|
|
|
650
|
9
|
100
|
|
|
|
|
if(SvIOK(b)) { |
651
|
4
|
50
|
|
|
|
|
if(SWITCH_ARGS) *pc = (double)SvIVX(b) / *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
652
|
3
|
|
|
|
|
|
else *pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) / (double)SvIVX(b); |
653
|
4
|
|
|
|
|
|
return obj_ref; |
654
|
|
|
|
|
|
|
} |
655
|
|
|
|
|
|
|
|
656
|
5
|
100
|
|
|
|
|
if(SvNOK(b)) { |
657
|
1
|
50
|
|
|
|
|
if(SWITCH_ARGS) *pc = (double)SvNVX(b) / *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
658
|
1
|
|
|
|
|
|
else *pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) / (double)SvNVX(b); |
659
|
1
|
|
|
|
|
|
return obj_ref; |
660
|
|
|
|
|
|
|
} |
661
|
4
|
100
|
|
|
|
|
if(SvPOK(b)) { |
662
|
2
|
50
|
|
|
|
|
if(!looks_like_number(b)) nnum++; |
663
|
2
|
50
|
|
|
|
|
if(SWITCH_ARGS) *pc = strtod(SvPV_nolen(b), NULL) / *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
664
|
1
|
50
|
|
|
|
|
else *pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) / strtod(SvPV_nolen(b), NULL); |
665
|
2
|
|
|
|
|
|
return obj_ref; |
666
|
|
|
|
|
|
|
} |
667
|
2
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
668
|
2
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
669
|
2
|
50
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) { |
670
|
2
|
|
|
|
|
|
*pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) / *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b)))); |
671
|
2
|
|
|
|
|
|
return obj_ref; |
672
|
|
|
|
|
|
|
} |
673
|
|
|
|
|
|
|
} |
674
|
|
|
|
|
|
|
|
675
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Complex_C::_overload_div function"); |
676
|
|
|
|
|
|
|
} |
677
|
|
|
|
|
|
|
|
678
|
8
|
|
|
|
|
|
SV * _overload_sub(pTHX_ SV * a, SV * b, SV * third) { |
679
|
|
|
|
|
|
|
MATH_COMPLEX *pc; |
680
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
681
|
|
|
|
|
|
|
|
682
|
8
|
|
|
|
|
|
New(42, pc, 1, MATH_COMPLEX); |
683
|
8
|
50
|
|
|
|
|
if(pc == NULL) croak("Failed to allocate memory in _overload_sub function"); |
684
|
|
|
|
|
|
|
|
685
|
8
|
|
|
|
|
|
obj_ref = newSV(0); |
686
|
8
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Complex_C"); |
687
|
|
|
|
|
|
|
|
688
|
8
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,pc)); |
689
|
8
|
|
|
|
|
|
SvREADONLY_on(obj); |
690
|
|
|
|
|
|
|
|
691
|
8
|
50
|
|
|
|
|
if(SvUOK(b)) { |
692
|
0
|
0
|
|
|
|
|
if(SWITCH_ARGS) *pc = (double)SvUVX(b) - *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
693
|
0
|
|
|
|
|
|
else *pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) - (double)SvUVX(b); |
694
|
0
|
|
|
|
|
|
return obj_ref; |
695
|
|
|
|
|
|
|
} |
696
|
|
|
|
|
|
|
|
697
|
8
|
100
|
|
|
|
|
if(SvIOK(b)) { |
698
|
4
|
50
|
|
|
|
|
if(SWITCH_ARGS) *pc = (double)SvIVX(b) - *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
699
|
3
|
|
|
|
|
|
else *pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) - (double)SvIVX(b); |
700
|
4
|
|
|
|
|
|
return obj_ref; |
701
|
|
|
|
|
|
|
} |
702
|
|
|
|
|
|
|
|
703
|
4
|
100
|
|
|
|
|
if(SvNOK(b)) { |
704
|
1
|
50
|
|
|
|
|
if(SWITCH_ARGS) *pc = (double)SvNVX(b) - *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
705
|
1
|
|
|
|
|
|
else *pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) - (double)SvNVX(b); |
706
|
1
|
|
|
|
|
|
return obj_ref; |
707
|
|
|
|
|
|
|
} |
708
|
3
|
100
|
|
|
|
|
if(SvPOK(b)) { |
709
|
2
|
50
|
|
|
|
|
if(!looks_like_number(b)) nnum++; |
710
|
2
|
50
|
|
|
|
|
if(SWITCH_ARGS) *pc = strtod(SvPV_nolen(b), NULL) - *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
711
|
1
|
50
|
|
|
|
|
else *pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) - strtod(SvPV_nolen(b), NULL); |
712
|
2
|
|
|
|
|
|
return obj_ref; |
713
|
|
|
|
|
|
|
} |
714
|
1
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
715
|
1
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
716
|
1
|
50
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) { |
717
|
1
|
|
|
|
|
|
*pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) - *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b)))); |
718
|
1
|
|
|
|
|
|
return obj_ref; |
719
|
|
|
|
|
|
|
} |
720
|
|
|
|
|
|
|
} |
721
|
|
|
|
|
|
|
|
722
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Complex_C::_overload_sub function"); |
723
|
|
|
|
|
|
|
} |
724
|
|
|
|
|
|
|
|
725
|
1
|
|
|
|
|
|
SV * _overload_sqrt(pTHX_ SV * a, SV * b, SV * third) { |
726
|
|
|
|
|
|
|
MATH_COMPLEX *pc; |
727
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
728
|
|
|
|
|
|
|
|
729
|
1
|
|
|
|
|
|
New(42, pc, 1, MATH_COMPLEX); |
730
|
1
|
50
|
|
|
|
|
if(pc == NULL) croak("Failed to allocate memory in _overload_sqrt function"); |
731
|
|
|
|
|
|
|
|
732
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
733
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Complex_C"); |
734
|
|
|
|
|
|
|
|
735
|
1
|
|
|
|
|
|
*pc = csqrt(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))); |
736
|
|
|
|
|
|
|
|
737
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,pc)); |
738
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
739
|
1
|
|
|
|
|
|
return obj_ref; |
740
|
|
|
|
|
|
|
} |
741
|
|
|
|
|
|
|
|
742
|
4
|
|
|
|
|
|
SV * _overload_pow_eq(pTHX_ SV * a, SV * b, SV * third) { |
743
|
|
|
|
|
|
|
MATH_COMPLEX t; |
744
|
4
|
|
|
|
|
|
SvREFCNT_inc(a); |
745
|
|
|
|
|
|
|
|
746
|
4
|
50
|
|
|
|
|
if(SvUOK(b)) { |
747
|
0
|
|
|
|
|
|
__real__ t = (double)SvUVX(b); |
748
|
0
|
|
|
|
|
|
__imag__ t = 0.0; |
749
|
0
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) = MY_CPOW(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))), t); |
750
|
0
|
|
|
|
|
|
return a; |
751
|
|
|
|
|
|
|
} |
752
|
4
|
100
|
|
|
|
|
if(SvIOK(b)) { |
753
|
3
|
|
|
|
|
|
__real__ t = (double)SvIVX(b); |
754
|
3
|
|
|
|
|
|
__imag__ t = 0.0; |
755
|
3
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) = MY_CPOW(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))), t); |
756
|
3
|
|
|
|
|
|
return a; |
757
|
|
|
|
|
|
|
} |
758
|
1
|
50
|
|
|
|
|
if(SvNOK(b)) { |
759
|
1
|
|
|
|
|
|
__real__ t = (double)SvNVX(b); |
760
|
1
|
|
|
|
|
|
__imag__ t = 0.0; |
761
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) = MY_CPOW(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))), t); |
762
|
1
|
|
|
|
|
|
return a; |
763
|
|
|
|
|
|
|
} |
764
|
0
|
0
|
|
|
|
|
if(SvPOK(b)) { |
765
|
0
|
0
|
|
|
|
|
if(!looks_like_number(b)) nnum++; |
766
|
0
|
0
|
|
|
|
|
__real__ t = strtod(SvPV_nolen(b), NULL); |
767
|
0
|
|
|
|
|
|
__imag__ t = 0.0; |
768
|
0
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) = MY_CPOW(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))), t); |
769
|
0
|
|
|
|
|
|
return a; |
770
|
|
|
|
|
|
|
} |
771
|
0
|
0
|
|
|
|
|
if(sv_isobject(b)) { |
772
|
0
|
0
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
773
|
0
|
0
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) { |
774
|
0
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) = MY_CPOW(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))), |
775
|
0
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b))))); |
776
|
0
|
|
|
|
|
|
return a; |
777
|
|
|
|
|
|
|
} |
778
|
|
|
|
|
|
|
} |
779
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
780
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Complex_C::_overload_pow_eq function"); |
781
|
|
|
|
|
|
|
} |
782
|
|
|
|
|
|
|
|
783
|
7
|
|
|
|
|
|
SV * _overload_mul_eq(pTHX_ SV * a, SV * b, SV * third) { |
784
|
7
|
|
|
|
|
|
SvREFCNT_inc(a); |
785
|
|
|
|
|
|
|
|
786
|
7
|
50
|
|
|
|
|
if(SvUOK(b)) { |
787
|
0
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) *= (double)SvUVX(b); |
788
|
0
|
|
|
|
|
|
return a; |
789
|
|
|
|
|
|
|
} |
790
|
|
|
|
|
|
|
|
791
|
7
|
100
|
|
|
|
|
if(SvIOK(b)) { |
792
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) *= (double)SvIVX(b); |
793
|
2
|
|
|
|
|
|
return a; |
794
|
|
|
|
|
|
|
} |
795
|
|
|
|
|
|
|
|
796
|
5
|
100
|
|
|
|
|
if(SvNOK(b)) { |
797
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) *= (double)SvNVX(b); |
798
|
1
|
|
|
|
|
|
return a; |
799
|
|
|
|
|
|
|
} |
800
|
|
|
|
|
|
|
|
801
|
4
|
100
|
|
|
|
|
if(SvPOK(b)) { |
802
|
2
|
100
|
|
|
|
|
if(!looks_like_number(b)) nnum++; |
803
|
2
|
50
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) *= strtod(SvPV_nolen(b), NULL); |
804
|
2
|
|
|
|
|
|
return a; |
805
|
|
|
|
|
|
|
} |
806
|
|
|
|
|
|
|
|
807
|
2
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
808
|
2
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
809
|
2
|
50
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) { |
810
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) *= *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b)))); |
811
|
2
|
|
|
|
|
|
return a; |
812
|
|
|
|
|
|
|
} |
813
|
|
|
|
|
|
|
} |
814
|
|
|
|
|
|
|
|
815
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
816
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Complex_C::_overload_mul_eq function"); |
817
|
|
|
|
|
|
|
} |
818
|
|
|
|
|
|
|
|
819
|
6
|
|
|
|
|
|
SV * _overload_add_eq(pTHX_ SV * a, SV * b, SV * third) { |
820
|
6
|
|
|
|
|
|
SvREFCNT_inc(a); |
821
|
|
|
|
|
|
|
|
822
|
6
|
50
|
|
|
|
|
if(SvUOK(b)) { |
823
|
0
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) += (double)SvUVX(b); |
824
|
0
|
|
|
|
|
|
return a; |
825
|
|
|
|
|
|
|
} |
826
|
|
|
|
|
|
|
|
827
|
6
|
100
|
|
|
|
|
if(SvIOK(b)) { |
828
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) += (double)SvIVX(b); |
829
|
2
|
|
|
|
|
|
return a; |
830
|
|
|
|
|
|
|
} |
831
|
|
|
|
|
|
|
|
832
|
4
|
100
|
|
|
|
|
if(SvNOK(b)) { |
833
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) += (double)SvNVX(b); |
834
|
1
|
|
|
|
|
|
return a; |
835
|
|
|
|
|
|
|
} |
836
|
|
|
|
|
|
|
|
837
|
3
|
100
|
|
|
|
|
if(SvPOK(b)) { |
838
|
1
|
50
|
|
|
|
|
if(!looks_like_number(b)) nnum++; |
839
|
1
|
50
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) += strtod(SvPV_nolen(b), NULL); |
840
|
1
|
|
|
|
|
|
return a; |
841
|
|
|
|
|
|
|
} |
842
|
|
|
|
|
|
|
|
843
|
2
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
844
|
2
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
845
|
2
|
50
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) { |
846
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) += *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b)))); |
847
|
2
|
|
|
|
|
|
return a; |
848
|
|
|
|
|
|
|
} |
849
|
|
|
|
|
|
|
} |
850
|
|
|
|
|
|
|
|
851
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
852
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Complex_C::_overload_add_eq function"); |
853
|
|
|
|
|
|
|
} |
854
|
|
|
|
|
|
|
|
855
|
5
|
|
|
|
|
|
SV * _overload_div_eq(pTHX_ SV * a, SV * b, SV * third) { |
856
|
5
|
|
|
|
|
|
SvREFCNT_inc(a); |
857
|
|
|
|
|
|
|
|
858
|
5
|
50
|
|
|
|
|
if(SvUOK(b)) { |
859
|
0
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) /= (double)SvUVX(b); |
860
|
0
|
|
|
|
|
|
return a; |
861
|
|
|
|
|
|
|
} |
862
|
|
|
|
|
|
|
|
863
|
5
|
100
|
|
|
|
|
if(SvIOK(b)) { |
864
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) /= (double)SvIVX(b); |
865
|
2
|
|
|
|
|
|
return a; |
866
|
|
|
|
|
|
|
} |
867
|
|
|
|
|
|
|
|
868
|
3
|
100
|
|
|
|
|
if(SvNOK(b)) { |
869
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) /= (double)SvNVX(b); |
870
|
1
|
|
|
|
|
|
return a; |
871
|
|
|
|
|
|
|
} |
872
|
|
|
|
|
|
|
|
873
|
2
|
100
|
|
|
|
|
if(SvPOK(b)) { |
874
|
1
|
50
|
|
|
|
|
if(!looks_like_number(b)) nnum++; |
875
|
1
|
50
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) /= strtod(SvPV_nolen(b), NULL); |
876
|
1
|
|
|
|
|
|
return a; |
877
|
|
|
|
|
|
|
} |
878
|
|
|
|
|
|
|
|
879
|
1
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
880
|
1
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
881
|
1
|
50
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) { |
882
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) /= *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b)))); |
883
|
1
|
|
|
|
|
|
return a; |
884
|
|
|
|
|
|
|
} |
885
|
|
|
|
|
|
|
} |
886
|
|
|
|
|
|
|
|
887
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
888
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Complex_C::_overload_div_eq function"); |
889
|
|
|
|
|
|
|
} |
890
|
|
|
|
|
|
|
|
891
|
5
|
|
|
|
|
|
SV * _overload_sub_eq(pTHX_ SV * a, SV * b, SV * third) { |
892
|
5
|
|
|
|
|
|
SvREFCNT_inc(a); |
893
|
|
|
|
|
|
|
|
894
|
5
|
50
|
|
|
|
|
if(SvUOK(b)) { |
895
|
0
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) -= (double)SvUVX(b); |
896
|
0
|
|
|
|
|
|
return a; |
897
|
|
|
|
|
|
|
} |
898
|
|
|
|
|
|
|
|
899
|
5
|
100
|
|
|
|
|
if(SvIOK(b)) { |
900
|
2
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) -= (double)SvIVX(b); |
901
|
2
|
|
|
|
|
|
return a; |
902
|
|
|
|
|
|
|
} |
903
|
|
|
|
|
|
|
|
904
|
3
|
100
|
|
|
|
|
if(SvNOK(b)) { |
905
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) -= (double)SvNVX(b); |
906
|
1
|
|
|
|
|
|
return a; |
907
|
|
|
|
|
|
|
} |
908
|
|
|
|
|
|
|
|
909
|
2
|
100
|
|
|
|
|
if(SvPOK(b)) { |
910
|
1
|
50
|
|
|
|
|
if(!looks_like_number(b)) nnum++; |
911
|
1
|
50
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) -= strtod(SvPV_nolen(b), NULL); |
912
|
1
|
|
|
|
|
|
return a; |
913
|
|
|
|
|
|
|
} |
914
|
|
|
|
|
|
|
|
915
|
1
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
916
|
1
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
917
|
1
|
50
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) { |
918
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) -= *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b)))); |
919
|
1
|
|
|
|
|
|
return a; |
920
|
|
|
|
|
|
|
} |
921
|
|
|
|
|
|
|
} |
922
|
|
|
|
|
|
|
|
923
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
924
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Complex_C::_overload_sub_eq function"); |
925
|
|
|
|
|
|
|
} |
926
|
|
|
|
|
|
|
|
927
|
4
|
|
|
|
|
|
SV * _overload_copy(pTHX_ SV * a, SV * second, SV * third) { |
928
|
|
|
|
|
|
|
|
929
|
|
|
|
|
|
|
MATH_COMPLEX *pc; |
930
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
931
|
|
|
|
|
|
|
|
932
|
4
|
|
|
|
|
|
New(42, pc, 1, MATH_COMPLEX); |
933
|
4
|
50
|
|
|
|
|
if(pc == NULL) croak("Failed to allocate memory in _overload_copy function"); |
934
|
|
|
|
|
|
|
|
935
|
4
|
|
|
|
|
|
obj_ref = newSV(0); |
936
|
4
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Complex_C"); |
937
|
|
|
|
|
|
|
|
938
|
4
|
|
|
|
|
|
__real__ *pc = __real__ *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))); |
939
|
4
|
|
|
|
|
|
__imag__ *pc = __imag__ *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))); |
940
|
|
|
|
|
|
|
|
941
|
4
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,pc)); |
942
|
4
|
|
|
|
|
|
SvREADONLY_on(obj); |
943
|
4
|
|
|
|
|
|
return obj_ref; |
944
|
|
|
|
|
|
|
|
945
|
|
|
|
|
|
|
} |
946
|
|
|
|
|
|
|
|
947
|
1
|
|
|
|
|
|
SV * _overload_abs(pTHX_ SV * rop, SV * second, SV * third) { |
948
|
1
|
|
|
|
|
|
return newSVnv(cabs(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(rop)))))); |
949
|
|
|
|
|
|
|
} |
950
|
|
|
|
|
|
|
|
951
|
1
|
|
|
|
|
|
SV * _overload_exp(pTHX_ SV * a, SV * b, SV * third) { |
952
|
|
|
|
|
|
|
MATH_COMPLEX *pc; |
953
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
954
|
|
|
|
|
|
|
|
955
|
1
|
|
|
|
|
|
New(42, pc, 1, MATH_COMPLEX); |
956
|
1
|
50
|
|
|
|
|
if(pc == NULL) croak("Failed to allocate memory in _overload_exp function"); |
957
|
|
|
|
|
|
|
|
958
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
959
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Complex_C"); |
960
|
|
|
|
|
|
|
|
961
|
1
|
|
|
|
|
|
*pc = cexp(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))); |
962
|
|
|
|
|
|
|
|
963
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,pc)); |
964
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
965
|
1
|
|
|
|
|
|
return obj_ref; |
966
|
|
|
|
|
|
|
} |
967
|
|
|
|
|
|
|
|
968
|
1
|
|
|
|
|
|
SV * _overload_log(pTHX_ SV * a, SV * b, SV * third) { |
969
|
|
|
|
|
|
|
MATH_COMPLEX *pc; |
970
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
971
|
|
|
|
|
|
|
|
972
|
1
|
|
|
|
|
|
New(42, pc, 1, MATH_COMPLEX); |
973
|
1
|
50
|
|
|
|
|
if(pc == NULL) croak("Failed to allocate memory in _overload_log function"); |
974
|
|
|
|
|
|
|
|
975
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
976
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Complex_C"); |
977
|
|
|
|
|
|
|
|
978
|
1
|
|
|
|
|
|
*pc = clog(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))); |
979
|
|
|
|
|
|
|
|
980
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,pc)); |
981
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
982
|
1
|
|
|
|
|
|
return obj_ref; |
983
|
|
|
|
|
|
|
} |
984
|
|
|
|
|
|
|
|
985
|
1
|
|
|
|
|
|
SV * _overload_sin(pTHX_ SV * a, SV * b, SV * third) { |
986
|
|
|
|
|
|
|
MATH_COMPLEX *pc; |
987
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
988
|
|
|
|
|
|
|
|
989
|
1
|
|
|
|
|
|
New(42, pc, 1, MATH_COMPLEX); |
990
|
1
|
50
|
|
|
|
|
if(pc == NULL) croak("Failed to allocate memory in _overload_sin function"); |
991
|
|
|
|
|
|
|
|
992
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
993
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Complex_C"); |
994
|
|
|
|
|
|
|
|
995
|
1
|
|
|
|
|
|
*pc = csin(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))); |
996
|
|
|
|
|
|
|
|
997
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,pc)); |
998
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
999
|
1
|
|
|
|
|
|
return obj_ref; |
1000
|
|
|
|
|
|
|
} |
1001
|
|
|
|
|
|
|
|
1002
|
1
|
|
|
|
|
|
SV * _overload_cos(pTHX_ SV * a, SV * b, SV * third) { |
1003
|
|
|
|
|
|
|
MATH_COMPLEX *pc; |
1004
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
1005
|
|
|
|
|
|
|
|
1006
|
1
|
|
|
|
|
|
New(42, pc, 1, MATH_COMPLEX); |
1007
|
1
|
50
|
|
|
|
|
if(pc == NULL) croak("Failed to allocate memory in _overload_cos function"); |
1008
|
|
|
|
|
|
|
|
1009
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
1010
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Complex_C"); |
1011
|
|
|
|
|
|
|
|
1012
|
1
|
|
|
|
|
|
*pc = ccos(*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a))))); |
1013
|
|
|
|
|
|
|
|
1014
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,pc)); |
1015
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
1016
|
1
|
|
|
|
|
|
return obj_ref; |
1017
|
|
|
|
|
|
|
} |
1018
|
|
|
|
|
|
|
|
1019
|
1
|
|
|
|
|
|
SV * _overload_atan2(pTHX_ SV * a, SV * b, SV * third) { |
1020
|
|
|
|
|
|
|
MATH_COMPLEX *pc; |
1021
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
1022
|
|
|
|
|
|
|
|
1023
|
1
|
|
|
|
|
|
New(42, pc, 1, MATH_COMPLEX); |
1024
|
1
|
50
|
|
|
|
|
if(pc == NULL) croak("Failed to allocate memory in _overload_atan2 function"); |
1025
|
|
|
|
|
|
|
|
1026
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
1027
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Complex_C"); |
1028
|
|
|
|
|
|
|
|
1029
|
2
|
|
|
|
|
|
*pc = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(a)))) / |
1030
|
1
|
|
|
|
|
|
*(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(b)))) ; |
1031
|
|
|
|
|
|
|
|
1032
|
1
|
|
|
|
|
|
*pc = catan(*pc); |
1033
|
|
|
|
|
|
|
|
1034
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,pc)); |
1035
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
1036
|
1
|
|
|
|
|
|
return obj_ref; |
1037
|
|
|
|
|
|
|
} |
1038
|
|
|
|
|
|
|
|
1039
|
4
|
|
|
|
|
|
SV * get_nan(pTHX) { |
1040
|
4
|
|
|
|
|
|
return newSVnv(_get_nan()); |
1041
|
|
|
|
|
|
|
} |
1042
|
|
|
|
|
|
|
|
1043
|
2
|
|
|
|
|
|
SV * get_inf(pTHX) { |
1044
|
2
|
|
|
|
|
|
return newSVnv(_get_inf()); |
1045
|
|
|
|
|
|
|
} |
1046
|
|
|
|
|
|
|
|
1047
|
0
|
|
|
|
|
|
SV * get_neg_inf(pTHX) { |
1048
|
0
|
|
|
|
|
|
return newSVnv(_get_neg_inf()); |
1049
|
|
|
|
|
|
|
} |
1050
|
|
|
|
|
|
|
|
1051
|
1
|
|
|
|
|
|
SV * is_nan(pTHX_ SV * a) { |
1052
|
1
|
50
|
|
|
|
|
if(SvNV(a) == SvNV(a)) return newSVuv(0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1053
|
1
|
|
|
|
|
|
return newSVuv(1); |
1054
|
|
|
|
|
|
|
} |
1055
|
|
|
|
|
|
|
|
1056
|
6
|
|
|
|
|
|
SV * is_inf(pTHX_ SV * a) { |
1057
|
6
|
50
|
|
|
|
|
double t = (double)SvNV(a); |
1058
|
6
|
50
|
|
|
|
|
if(t == 0) return newSVuv(0); |
1059
|
6
|
50
|
|
|
|
|
if(t != t) return newSVuv(0); |
1060
|
6
|
50
|
|
|
|
|
if(t / t == t / t) return newSVuv(0); |
1061
|
6
|
50
|
|
|
|
|
if(t < 0) return newSViv(-1); |
1062
|
6
|
|
|
|
|
|
return newSViv(1); |
1063
|
|
|
|
|
|
|
} |
1064
|
|
|
|
|
|
|
|
1065
|
0
|
|
|
|
|
|
SV * _complex_type(pTHX) { |
1066
|
0
|
|
|
|
|
|
return newSVpv("__complex128", 0); |
1067
|
|
|
|
|
|
|
} |
1068
|
|
|
|
|
|
|
|
1069
|
0
|
|
|
|
|
|
SV * _double_type(pTHX) { |
1070
|
0
|
|
|
|
|
|
return newSVpv("__long double", 0); |
1071
|
|
|
|
|
|
|
} |
1072
|
|
|
|
|
|
|
|
1073
|
0
|
|
|
|
|
|
SV * _get_nv(pTHX_ SV * x) { |
1074
|
0
|
0
|
|
|
|
|
return newSVnv(SvNV(x)); |
1075
|
|
|
|
|
|
|
} |
1076
|
|
|
|
|
|
|
|
1077
|
0
|
|
|
|
|
|
SV * _which_package(pTHX_ SV * b) { |
1078
|
0
|
0
|
|
|
|
|
if(sv_isobject(b)) return newSVpv(HvNAME(SvSTASH(SvRV(b))), 0); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1079
|
0
|
|
|
|
|
|
return newSVpv("Not an object", 0); |
1080
|
|
|
|
|
|
|
} |
1081
|
|
|
|
|
|
|
|
1082
|
0
|
|
|
|
|
|
SV * _wrap_count(pTHX) { |
1083
|
0
|
|
|
|
|
|
return newSVuv(PL_sv_count); |
1084
|
|
|
|
|
|
|
} |
1085
|
|
|
|
|
|
|
|
1086
|
0
|
|
|
|
|
|
SV * _ivsize(pTHX) { |
1087
|
0
|
|
|
|
|
|
return newSViv(sizeof(IV)); |
1088
|
|
|
|
|
|
|
} |
1089
|
|
|
|
|
|
|
|
1090
|
0
|
|
|
|
|
|
SV * _nvsize(pTHX) { |
1091
|
0
|
|
|
|
|
|
return newSViv(sizeof(NV)); |
1092
|
|
|
|
|
|
|
} |
1093
|
|
|
|
|
|
|
|
1094
|
0
|
|
|
|
|
|
SV * _doublesize(pTHX) { |
1095
|
0
|
|
|
|
|
|
return newSViv(sizeof(double)); |
1096
|
|
|
|
|
|
|
} |
1097
|
|
|
|
|
|
|
|
1098
|
0
|
|
|
|
|
|
SV * _longdoublesize(pTHX) { |
1099
|
0
|
|
|
|
|
|
return newSViv(sizeof(long double)); |
1100
|
|
|
|
|
|
|
} |
1101
|
|
|
|
|
|
|
|
1102
|
0
|
|
|
|
|
|
SV * _double_Complexsize(pTHX) { |
1103
|
0
|
|
|
|
|
|
return newSViv(sizeof(double _Complex)); |
1104
|
|
|
|
|
|
|
} |
1105
|
|
|
|
|
|
|
|
1106
|
0
|
|
|
|
|
|
SV * _longdouble_Complexsize(pTHX) { |
1107
|
0
|
|
|
|
|
|
return newSViv(sizeof(long double _Complex)); |
1108
|
|
|
|
|
|
|
} |
1109
|
|
|
|
|
|
|
|
1110
|
|
|
|
|
|
|
|
1111
|
10
|
|
|
|
|
|
void _d_to_str(pTHX_ SV * ld) { |
1112
|
10
|
|
|
|
|
|
dXSARGS; |
1113
|
|
|
|
|
|
|
MATH_COMPLEX t; |
1114
|
|
|
|
|
|
|
char *rbuffer; |
1115
|
|
|
|
|
|
|
int query; |
1116
|
|
|
|
|
|
|
|
1117
|
10
|
50
|
|
|
|
|
if(sv_isobject(ld)) { |
1118
|
10
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(ld))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1119
|
10
|
50
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) { |
1120
|
10
|
50
|
|
|
|
|
EXTEND(SP, 2); |
1121
|
|
|
|
|
|
|
|
1122
|
10
|
|
|
|
|
|
t = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(ld)))); |
1123
|
|
|
|
|
|
|
/**/ |
1124
|
10
|
|
|
|
|
|
Newx(rbuffer, 8 + _MATH_COMPLEX_C_DIGITS, char); |
1125
|
10
|
50
|
|
|
|
|
if(rbuffer == NULL) croak("Failed to allocate memory in d_to_str"); |
1126
|
|
|
|
|
|
|
|
1127
|
10
|
|
|
|
|
|
query = _is_inf(__real__ t); |
1128
|
10
|
100
|
|
|
|
|
if(query || _is_nan(__real__ t)) |
|
|
100
|
|
|
|
|
|
1129
|
7
|
100
|
|
|
|
|
sprintf(rbuffer, "%s", query ? query > 0 ? "inf" |
1130
|
2
|
100
|
|
|
|
|
: "-inf" |
1131
|
|
|
|
|
|
|
: "nan"); |
1132
|
|
|
|
|
|
|
else |
1133
|
5
|
|
|
|
|
|
sprintf(rbuffer, "%.*e", _MATH_COMPLEX_C_DIGITS - 1, __real__ t); |
1134
|
|
|
|
|
|
|
|
1135
|
10
|
|
|
|
|
|
ST(0) = sv_2mortal(newSVpv(rbuffer, 0)); |
1136
|
|
|
|
|
|
|
|
1137
|
10
|
|
|
|
|
|
query = _is_inf(__imag__ t); |
1138
|
10
|
100
|
|
|
|
|
if(query || _is_nan(__imag__ t)) |
|
|
100
|
|
|
|
|
|
1139
|
7
|
100
|
|
|
|
|
sprintf(rbuffer, "%s", query ? query > 0 ? "inf" |
1140
|
2
|
100
|
|
|
|
|
: "-inf" |
1141
|
|
|
|
|
|
|
: "nan"); |
1142
|
|
|
|
|
|
|
else |
1143
|
5
|
|
|
|
|
|
sprintf(rbuffer, "%.*e", _MATH_COMPLEX_C_DIGITS - 1, __imag__ t); |
1144
|
|
|
|
|
|
|
|
1145
|
10
|
|
|
|
|
|
ST(1) = sv_2mortal(newSVpv(rbuffer, 0)); |
1146
|
|
|
|
|
|
|
/**/ |
1147
|
10
|
|
|
|
|
|
Safefree(rbuffer); |
1148
|
10
|
|
|
|
|
|
XSRETURN(2); |
1149
|
|
|
|
|
|
|
} |
1150
|
0
|
|
|
|
|
|
else croak("d_to_str function needs a Math::Complex_C arg but was supplied with a %s arg", h); |
1151
|
|
|
|
|
|
|
} |
1152
|
0
|
|
|
|
|
|
else croak("Invalid argument supplied to Math::Complex_C::d_to_str function"); |
1153
|
|
|
|
|
|
|
} |
1154
|
|
|
|
|
|
|
|
1155
|
3
|
|
|
|
|
|
void _d_to_strp(pTHX_ SV * ld, int decimal_prec) { |
1156
|
3
|
|
|
|
|
|
dXSARGS; |
1157
|
|
|
|
|
|
|
MATH_COMPLEX t; |
1158
|
|
|
|
|
|
|
char *rbuffer; |
1159
|
|
|
|
|
|
|
int query; |
1160
|
|
|
|
|
|
|
|
1161
|
3
|
50
|
|
|
|
|
if(decimal_prec < 1)croak("2nd arg (precision) to _d_to_strp must be at least 1"); |
1162
|
|
|
|
|
|
|
|
1163
|
3
|
50
|
|
|
|
|
if(sv_isobject(ld)) { |
1164
|
3
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(ld))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1165
|
3
|
50
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) { |
1166
|
3
|
50
|
|
|
|
|
EXTEND(SP, 2); |
1167
|
3
|
|
|
|
|
|
t = *(INT2PTR(MATH_COMPLEX *, SvIVX(SvRV(ld)))); |
1168
|
|
|
|
|
|
|
/* new */ |
1169
|
3
|
|
|
|
|
|
Newx(rbuffer, 8 + decimal_prec, char); |
1170
|
3
|
50
|
|
|
|
|
if(rbuffer == NULL) croak("Failed to allocate memory in d_to_strp"); |
1171
|
|
|
|
|
|
|
|
1172
|
3
|
|
|
|
|
|
query = _is_inf(__real__ t); |
1173
|
3
|
100
|
|
|
|
|
if(query || _is_nan(__real__ t)) |
|
|
50
|
|
|
|
|
|
1174
|
5
|
100
|
|
|
|
|
sprintf(rbuffer, "%s", query ? query > 0 ? "inf" |
1175
|
2
|
100
|
|
|
|
|
: "-inf" |
1176
|
|
|
|
|
|
|
: "nan"); |
1177
|
|
|
|
|
|
|
else |
1178
|
0
|
|
|
|
|
|
sprintf(rbuffer, "%.*e", decimal_prec - 1, __real__ t); |
1179
|
|
|
|
|
|
|
|
1180
|
3
|
|
|
|
|
|
ST(0) = sv_2mortal(newSVpv(rbuffer, 0)); |
1181
|
|
|
|
|
|
|
|
1182
|
3
|
|
|
|
|
|
query = _is_inf(__imag__ t); |
1183
|
3
|
100
|
|
|
|
|
if(query || _is_nan(__imag__ t)) |
|
|
50
|
|
|
|
|
|
1184
|
5
|
100
|
|
|
|
|
sprintf(rbuffer, "%s", query ? query > 0 ? "inf" |
1185
|
2
|
100
|
|
|
|
|
: "-inf" |
1186
|
|
|
|
|
|
|
: "nan"); |
1187
|
|
|
|
|
|
|
else |
1188
|
0
|
|
|
|
|
|
sprintf(rbuffer, "%.*e", decimal_prec - 1, __imag__ t); |
1189
|
|
|
|
|
|
|
|
1190
|
3
|
|
|
|
|
|
ST(1) = sv_2mortal(newSVpv(rbuffer, 0)); |
1191
|
|
|
|
|
|
|
/**/ |
1192
|
3
|
|
|
|
|
|
Safefree(rbuffer); |
1193
|
3
|
|
|
|
|
|
XSRETURN(2); |
1194
|
|
|
|
|
|
|
} |
1195
|
0
|
|
|
|
|
|
else croak("d_to_strp function needs a Math::Complex_C arg but was supplied with a %s arg", h); |
1196
|
|
|
|
|
|
|
} |
1197
|
0
|
|
|
|
|
|
else croak("Invalid argument supplied to Math::Complex_C::d_to_strp function"); |
1198
|
|
|
|
|
|
|
} |
1199
|
|
|
|
|
|
|
|
1200
|
0
|
|
|
|
|
|
SV * _LDBL_DIG(pTHX) { |
1201
|
|
|
|
|
|
|
#ifdef LDBL_DIG |
1202
|
0
|
|
|
|
|
|
return newSViv(LDBL_DIG); |
1203
|
|
|
|
|
|
|
#else |
1204
|
|
|
|
|
|
|
return 0; |
1205
|
|
|
|
|
|
|
#endif |
1206
|
|
|
|
|
|
|
} |
1207
|
|
|
|
|
|
|
|
1208
|
0
|
|
|
|
|
|
SV * _DBL_DIG(pTHX) { |
1209
|
|
|
|
|
|
|
#ifdef DBL_DIG |
1210
|
0
|
|
|
|
|
|
return newSViv(DBL_DIG); |
1211
|
|
|
|
|
|
|
#else |
1212
|
|
|
|
|
|
|
return 0; |
1213
|
|
|
|
|
|
|
#endif |
1214
|
|
|
|
|
|
|
} |
1215
|
|
|
|
|
|
|
|
1216
|
0
|
|
|
|
|
|
SV * _get_xs_version(pTHX) { |
1217
|
0
|
|
|
|
|
|
return newSVpv(XS_VERSION, 0); |
1218
|
|
|
|
|
|
|
} |
1219
|
|
|
|
|
|
|
|
1220
|
16
|
|
|
|
|
|
SV * _itsa(pTHX_ SV * a) { |
1221
|
16
|
50
|
|
|
|
|
if(SvUOK(a)) return newSVuv(1); |
1222
|
16
|
100
|
|
|
|
|
if(SvIOK(a)) return newSVuv(2); |
1223
|
15
|
50
|
|
|
|
|
if(SvNOK(a)) return newSVuv(3); |
1224
|
0
|
0
|
|
|
|
|
if(SvPOK(a)) return newSVuv(4); |
1225
|
0
|
0
|
|
|
|
|
if(sv_isobject(a)) { |
1226
|
0
|
0
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(a))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1227
|
0
|
0
|
|
|
|
|
if(strEQ(h, "Math::Complex_C")) return newSVuv(226); |
1228
|
|
|
|
|
|
|
} |
1229
|
0
|
|
|
|
|
|
return newSVuv(0); |
1230
|
|
|
|
|
|
|
} |
1231
|
|
|
|
|
|
|
|
1232
|
4
|
|
|
|
|
|
int nnumflag(void) { |
1233
|
4
|
|
|
|
|
|
return nnum; |
1234
|
|
|
|
|
|
|
} |
1235
|
|
|
|
|
|
|
|
1236
|
1
|
|
|
|
|
|
void clear_nnum(void) { |
1237
|
1
|
|
|
|
|
|
nnum = 0; |
1238
|
1
|
|
|
|
|
|
} |
1239
|
|
|
|
|
|
|
|
1240
|
1
|
|
|
|
|
|
void set_nnum(int x) { |
1241
|
1
|
|
|
|
|
|
nnum = x; |
1242
|
1
|
|
|
|
|
|
} |
1243
|
|
|
|
|
|
|
|
1244
|
0
|
|
|
|
|
|
int _lln(pTHX_ SV * x) { |
1245
|
0
|
0
|
|
|
|
|
if(looks_like_number(x)) return 1; |
1246
|
0
|
|
|
|
|
|
return 0; |
1247
|
|
|
|
|
|
|
} |
1248
|
|
|
|
|
|
|
|
1249
|
|
|
|
|
|
|
|
1250
|
|
|
|
|
|
|
MODULE = Math::Complex_C PACKAGE = Math::Complex_C |
1251
|
|
|
|
|
|
|
|
1252
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
1253
|
|
|
|
|
|
|
|
1254
|
|
|
|
|
|
|
|
1255
|
|
|
|
|
|
|
void |
1256
|
|
|
|
|
|
|
d_set_prec (x) |
1257
|
|
|
|
|
|
|
int x |
1258
|
|
|
|
|
|
|
PREINIT: |
1259
|
|
|
|
|
|
|
I32* temp; |
1260
|
|
|
|
|
|
|
PPCODE: |
1261
|
2
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1262
|
2
|
|
|
|
|
|
d_set_prec(aTHX_ x); |
1263
|
2
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1264
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1265
|
2
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1266
|
2
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1267
|
|
|
|
|
|
|
} |
1268
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1269
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1270
|
|
|
|
|
|
|
|
1271
|
|
|
|
|
|
|
int |
1272
|
|
|
|
|
|
|
d_get_prec () |
1273
|
|
|
|
|
|
|
|
1274
|
|
|
|
|
|
|
|
1275
|
|
|
|
|
|
|
int |
1276
|
|
|
|
|
|
|
_is_nan (x) |
1277
|
|
|
|
|
|
|
double x |
1278
|
|
|
|
|
|
|
|
1279
|
|
|
|
|
|
|
int |
1280
|
|
|
|
|
|
|
_is_inf (x) |
1281
|
|
|
|
|
|
|
double x |
1282
|
|
|
|
|
|
|
|
1283
|
|
|
|
|
|
|
double |
1284
|
|
|
|
|
|
|
_get_nan () |
1285
|
|
|
|
|
|
|
|
1286
|
|
|
|
|
|
|
|
1287
|
|
|
|
|
|
|
double |
1288
|
|
|
|
|
|
|
_get_inf () |
1289
|
|
|
|
|
|
|
|
1290
|
|
|
|
|
|
|
|
1291
|
|
|
|
|
|
|
double |
1292
|
|
|
|
|
|
|
_get_neg_inf () |
1293
|
|
|
|
|
|
|
|
1294
|
|
|
|
|
|
|
|
1295
|
|
|
|
|
|
|
SV * |
1296
|
|
|
|
|
|
|
create_c () |
1297
|
|
|
|
|
|
|
CODE: |
1298
|
72
|
|
|
|
|
|
RETVAL = create_c (aTHX); |
1299
|
|
|
|
|
|
|
OUTPUT: RETVAL |
1300
|
|
|
|
|
|
|
|
1301
|
|
|
|
|
|
|
|
1302
|
|
|
|
|
|
|
void |
1303
|
|
|
|
|
|
|
assign_c (rop, d1, d2) |
1304
|
|
|
|
|
|
|
SV * rop |
1305
|
|
|
|
|
|
|
SV * d1 |
1306
|
|
|
|
|
|
|
SV * d2 |
1307
|
|
|
|
|
|
|
PREINIT: |
1308
|
|
|
|
|
|
|
I32* temp; |
1309
|
|
|
|
|
|
|
PPCODE: |
1310
|
76
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1311
|
76
|
|
|
|
|
|
assign_c(aTHX_ rop, d1, d2); |
1312
|
76
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1313
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1314
|
76
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1315
|
76
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1316
|
|
|
|
|
|
|
} |
1317
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1318
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1319
|
|
|
|
|
|
|
|
1320
|
|
|
|
|
|
|
void |
1321
|
|
|
|
|
|
|
set_real_c (rop, d1) |
1322
|
|
|
|
|
|
|
SV * rop |
1323
|
|
|
|
|
|
|
SV * d1 |
1324
|
|
|
|
|
|
|
PREINIT: |
1325
|
|
|
|
|
|
|
I32* temp; |
1326
|
|
|
|
|
|
|
PPCODE: |
1327
|
4
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1328
|
4
|
|
|
|
|
|
set_real_c(aTHX_ rop, d1); |
1329
|
4
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1330
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1331
|
4
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1332
|
4
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1333
|
|
|
|
|
|
|
} |
1334
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1335
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1336
|
|
|
|
|
|
|
|
1337
|
|
|
|
|
|
|
void |
1338
|
|
|
|
|
|
|
set_imag_c (rop, d2) |
1339
|
|
|
|
|
|
|
SV * rop |
1340
|
|
|
|
|
|
|
SV * d2 |
1341
|
|
|
|
|
|
|
PREINIT: |
1342
|
|
|
|
|
|
|
I32* temp; |
1343
|
|
|
|
|
|
|
PPCODE: |
1344
|
4
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1345
|
4
|
|
|
|
|
|
set_imag_c(aTHX_ rop, d2); |
1346
|
4
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1347
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1348
|
4
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1349
|
4
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1350
|
|
|
|
|
|
|
} |
1351
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1352
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1353
|
|
|
|
|
|
|
|
1354
|
|
|
|
|
|
|
void |
1355
|
|
|
|
|
|
|
mul_c (rop, op1, op2) |
1356
|
|
|
|
|
|
|
SV * rop |
1357
|
|
|
|
|
|
|
SV * op1 |
1358
|
|
|
|
|
|
|
SV * op2 |
1359
|
|
|
|
|
|
|
PREINIT: |
1360
|
|
|
|
|
|
|
I32* temp; |
1361
|
|
|
|
|
|
|
PPCODE: |
1362
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1363
|
1
|
|
|
|
|
|
mul_c(aTHX_ rop, op1, op2); |
1364
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1365
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1366
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1367
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1368
|
|
|
|
|
|
|
} |
1369
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1370
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1371
|
|
|
|
|
|
|
|
1372
|
|
|
|
|
|
|
void |
1373
|
|
|
|
|
|
|
mul_c_nv (rop, op1, op2) |
1374
|
|
|
|
|
|
|
SV * rop |
1375
|
|
|
|
|
|
|
SV * op1 |
1376
|
|
|
|
|
|
|
SV * op2 |
1377
|
|
|
|
|
|
|
PREINIT: |
1378
|
|
|
|
|
|
|
I32* temp; |
1379
|
|
|
|
|
|
|
PPCODE: |
1380
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1381
|
1
|
|
|
|
|
|
mul_c_nv(aTHX_ rop, op1, op2); |
1382
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1383
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1384
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1385
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1386
|
|
|
|
|
|
|
} |
1387
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1388
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1389
|
|
|
|
|
|
|
|
1390
|
|
|
|
|
|
|
void |
1391
|
|
|
|
|
|
|
mul_c_iv (rop, op1, op2) |
1392
|
|
|
|
|
|
|
SV * rop |
1393
|
|
|
|
|
|
|
SV * op1 |
1394
|
|
|
|
|
|
|
SV * op2 |
1395
|
|
|
|
|
|
|
PREINIT: |
1396
|
|
|
|
|
|
|
I32* temp; |
1397
|
|
|
|
|
|
|
PPCODE: |
1398
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1399
|
1
|
|
|
|
|
|
mul_c_iv(aTHX_ rop, op1, op2); |
1400
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1401
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1402
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1403
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1404
|
|
|
|
|
|
|
} |
1405
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1406
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1407
|
|
|
|
|
|
|
|
1408
|
|
|
|
|
|
|
void |
1409
|
|
|
|
|
|
|
mul_c_uv (rop, op1, op2) |
1410
|
|
|
|
|
|
|
SV * rop |
1411
|
|
|
|
|
|
|
SV * op1 |
1412
|
|
|
|
|
|
|
SV * op2 |
1413
|
|
|
|
|
|
|
PREINIT: |
1414
|
|
|
|
|
|
|
I32* temp; |
1415
|
|
|
|
|
|
|
PPCODE: |
1416
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1417
|
1
|
|
|
|
|
|
mul_c_uv(aTHX_ rop, op1, op2); |
1418
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1419
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1420
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1421
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1422
|
|
|
|
|
|
|
} |
1423
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1424
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1425
|
|
|
|
|
|
|
|
1426
|
|
|
|
|
|
|
void |
1427
|
|
|
|
|
|
|
mul_c_pv (rop, op1, op2) |
1428
|
|
|
|
|
|
|
SV * rop |
1429
|
|
|
|
|
|
|
SV * op1 |
1430
|
|
|
|
|
|
|
SV * op2 |
1431
|
|
|
|
|
|
|
PREINIT: |
1432
|
|
|
|
|
|
|
I32* temp; |
1433
|
|
|
|
|
|
|
PPCODE: |
1434
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1435
|
1
|
|
|
|
|
|
mul_c_pv(aTHX_ rop, op1, op2); |
1436
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1437
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1438
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1439
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1440
|
|
|
|
|
|
|
} |
1441
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1442
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1443
|
|
|
|
|
|
|
|
1444
|
|
|
|
|
|
|
void |
1445
|
|
|
|
|
|
|
div_c (rop, op1, op2) |
1446
|
|
|
|
|
|
|
SV * rop |
1447
|
|
|
|
|
|
|
SV * op1 |
1448
|
|
|
|
|
|
|
SV * op2 |
1449
|
|
|
|
|
|
|
PREINIT: |
1450
|
|
|
|
|
|
|
I32* temp; |
1451
|
|
|
|
|
|
|
PPCODE: |
1452
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1453
|
1
|
|
|
|
|
|
div_c(aTHX_ rop, op1, op2); |
1454
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1455
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1456
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1457
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1458
|
|
|
|
|
|
|
} |
1459
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1460
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1461
|
|
|
|
|
|
|
|
1462
|
|
|
|
|
|
|
void |
1463
|
|
|
|
|
|
|
div_c_nv (rop, op1, op2) |
1464
|
|
|
|
|
|
|
SV * rop |
1465
|
|
|
|
|
|
|
SV * op1 |
1466
|
|
|
|
|
|
|
SV * op2 |
1467
|
|
|
|
|
|
|
PREINIT: |
1468
|
|
|
|
|
|
|
I32* temp; |
1469
|
|
|
|
|
|
|
PPCODE: |
1470
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1471
|
1
|
|
|
|
|
|
div_c_nv(aTHX_ rop, op1, op2); |
1472
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1473
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1474
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1475
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1476
|
|
|
|
|
|
|
} |
1477
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1478
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1479
|
|
|
|
|
|
|
|
1480
|
|
|
|
|
|
|
void |
1481
|
|
|
|
|
|
|
div_c_iv (rop, op1, op2) |
1482
|
|
|
|
|
|
|
SV * rop |
1483
|
|
|
|
|
|
|
SV * op1 |
1484
|
|
|
|
|
|
|
SV * op2 |
1485
|
|
|
|
|
|
|
PREINIT: |
1486
|
|
|
|
|
|
|
I32* temp; |
1487
|
|
|
|
|
|
|
PPCODE: |
1488
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1489
|
1
|
|
|
|
|
|
div_c_iv(aTHX_ rop, op1, op2); |
1490
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1491
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1492
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1493
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1494
|
|
|
|
|
|
|
} |
1495
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1496
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1497
|
|
|
|
|
|
|
|
1498
|
|
|
|
|
|
|
void |
1499
|
|
|
|
|
|
|
div_c_uv (rop, op1, op2) |
1500
|
|
|
|
|
|
|
SV * rop |
1501
|
|
|
|
|
|
|
SV * op1 |
1502
|
|
|
|
|
|
|
SV * op2 |
1503
|
|
|
|
|
|
|
PREINIT: |
1504
|
|
|
|
|
|
|
I32* temp; |
1505
|
|
|
|
|
|
|
PPCODE: |
1506
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1507
|
1
|
|
|
|
|
|
div_c_uv(aTHX_ rop, op1, op2); |
1508
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1509
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1510
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1511
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1512
|
|
|
|
|
|
|
} |
1513
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1514
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1515
|
|
|
|
|
|
|
|
1516
|
|
|
|
|
|
|
void |
1517
|
|
|
|
|
|
|
div_c_pv (rop, op1, op2) |
1518
|
|
|
|
|
|
|
SV * rop |
1519
|
|
|
|
|
|
|
SV * op1 |
1520
|
|
|
|
|
|
|
SV * op2 |
1521
|
|
|
|
|
|
|
PREINIT: |
1522
|
|
|
|
|
|
|
I32* temp; |
1523
|
|
|
|
|
|
|
PPCODE: |
1524
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1525
|
1
|
|
|
|
|
|
div_c_pv(aTHX_ rop, op1, op2); |
1526
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1527
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1528
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1529
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1530
|
|
|
|
|
|
|
} |
1531
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1532
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1533
|
|
|
|
|
|
|
|
1534
|
|
|
|
|
|
|
void |
1535
|
|
|
|
|
|
|
add_c (rop, op1, op2) |
1536
|
|
|
|
|
|
|
SV * rop |
1537
|
|
|
|
|
|
|
SV * op1 |
1538
|
|
|
|
|
|
|
SV * op2 |
1539
|
|
|
|
|
|
|
PREINIT: |
1540
|
|
|
|
|
|
|
I32* temp; |
1541
|
|
|
|
|
|
|
PPCODE: |
1542
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1543
|
1
|
|
|
|
|
|
add_c(aTHX_ rop, op1, op2); |
1544
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1545
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1546
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1547
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1548
|
|
|
|
|
|
|
} |
1549
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1550
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1551
|
|
|
|
|
|
|
|
1552
|
|
|
|
|
|
|
void |
1553
|
|
|
|
|
|
|
add_c_nv (rop, op1, op2) |
1554
|
|
|
|
|
|
|
SV * rop |
1555
|
|
|
|
|
|
|
SV * op1 |
1556
|
|
|
|
|
|
|
SV * op2 |
1557
|
|
|
|
|
|
|
PREINIT: |
1558
|
|
|
|
|
|
|
I32* temp; |
1559
|
|
|
|
|
|
|
PPCODE: |
1560
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1561
|
1
|
|
|
|
|
|
add_c_nv(aTHX_ rop, op1, op2); |
1562
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1563
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1564
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1565
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1566
|
|
|
|
|
|
|
} |
1567
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1568
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1569
|
|
|
|
|
|
|
|
1570
|
|
|
|
|
|
|
void |
1571
|
|
|
|
|
|
|
add_c_iv (rop, op1, op2) |
1572
|
|
|
|
|
|
|
SV * rop |
1573
|
|
|
|
|
|
|
SV * op1 |
1574
|
|
|
|
|
|
|
SV * op2 |
1575
|
|
|
|
|
|
|
PREINIT: |
1576
|
|
|
|
|
|
|
I32* temp; |
1577
|
|
|
|
|
|
|
PPCODE: |
1578
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1579
|
1
|
|
|
|
|
|
add_c_iv(aTHX_ rop, op1, op2); |
1580
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1581
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1582
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1583
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1584
|
|
|
|
|
|
|
} |
1585
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1586
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1587
|
|
|
|
|
|
|
|
1588
|
|
|
|
|
|
|
void |
1589
|
|
|
|
|
|
|
add_c_uv (rop, op1, op2) |
1590
|
|
|
|
|
|
|
SV * rop |
1591
|
|
|
|
|
|
|
SV * op1 |
1592
|
|
|
|
|
|
|
SV * op2 |
1593
|
|
|
|
|
|
|
PREINIT: |
1594
|
|
|
|
|
|
|
I32* temp; |
1595
|
|
|
|
|
|
|
PPCODE: |
1596
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1597
|
1
|
|
|
|
|
|
add_c_uv(aTHX_ rop, op1, op2); |
1598
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1599
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1600
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1601
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1602
|
|
|
|
|
|
|
} |
1603
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1604
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1605
|
|
|
|
|
|
|
|
1606
|
|
|
|
|
|
|
void |
1607
|
|
|
|
|
|
|
add_c_pv (rop, op1, op2) |
1608
|
|
|
|
|
|
|
SV * rop |
1609
|
|
|
|
|
|
|
SV * op1 |
1610
|
|
|
|
|
|
|
SV * op2 |
1611
|
|
|
|
|
|
|
PREINIT: |
1612
|
|
|
|
|
|
|
I32* temp; |
1613
|
|
|
|
|
|
|
PPCODE: |
1614
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1615
|
1
|
|
|
|
|
|
add_c_pv(aTHX_ rop, op1, op2); |
1616
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1617
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1618
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1619
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1620
|
|
|
|
|
|
|
} |
1621
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1622
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1623
|
|
|
|
|
|
|
|
1624
|
|
|
|
|
|
|
void |
1625
|
|
|
|
|
|
|
sub_c (rop, op1, op2) |
1626
|
|
|
|
|
|
|
SV * rop |
1627
|
|
|
|
|
|
|
SV * op1 |
1628
|
|
|
|
|
|
|
SV * op2 |
1629
|
|
|
|
|
|
|
PREINIT: |
1630
|
|
|
|
|
|
|
I32* temp; |
1631
|
|
|
|
|
|
|
PPCODE: |
1632
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1633
|
1
|
|
|
|
|
|
sub_c(aTHX_ rop, op1, op2); |
1634
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1635
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1636
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1637
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1638
|
|
|
|
|
|
|
} |
1639
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1640
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1641
|
|
|
|
|
|
|
|
1642
|
|
|
|
|
|
|
void |
1643
|
|
|
|
|
|
|
sub_c_nv (rop, op1, op2) |
1644
|
|
|
|
|
|
|
SV * rop |
1645
|
|
|
|
|
|
|
SV * op1 |
1646
|
|
|
|
|
|
|
SV * op2 |
1647
|
|
|
|
|
|
|
PREINIT: |
1648
|
|
|
|
|
|
|
I32* temp; |
1649
|
|
|
|
|
|
|
PPCODE: |
1650
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1651
|
1
|
|
|
|
|
|
sub_c_nv(aTHX_ rop, op1, op2); |
1652
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1653
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1654
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1655
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1656
|
|
|
|
|
|
|
} |
1657
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1658
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1659
|
|
|
|
|
|
|
|
1660
|
|
|
|
|
|
|
void |
1661
|
|
|
|
|
|
|
sub_c_iv (rop, op1, op2) |
1662
|
|
|
|
|
|
|
SV * rop |
1663
|
|
|
|
|
|
|
SV * op1 |
1664
|
|
|
|
|
|
|
SV * op2 |
1665
|
|
|
|
|
|
|
PREINIT: |
1666
|
|
|
|
|
|
|
I32* temp; |
1667
|
|
|
|
|
|
|
PPCODE: |
1668
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1669
|
1
|
|
|
|
|
|
sub_c_iv(aTHX_ rop, op1, op2); |
1670
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1671
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1672
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1673
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1674
|
|
|
|
|
|
|
} |
1675
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1676
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1677
|
|
|
|
|
|
|
|
1678
|
|
|
|
|
|
|
void |
1679
|
|
|
|
|
|
|
sub_c_uv (rop, op1, op2) |
1680
|
|
|
|
|
|
|
SV * rop |
1681
|
|
|
|
|
|
|
SV * op1 |
1682
|
|
|
|
|
|
|
SV * op2 |
1683
|
|
|
|
|
|
|
PREINIT: |
1684
|
|
|
|
|
|
|
I32* temp; |
1685
|
|
|
|
|
|
|
PPCODE: |
1686
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1687
|
1
|
|
|
|
|
|
sub_c_uv(aTHX_ rop, op1, op2); |
1688
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1689
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1690
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1691
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1692
|
|
|
|
|
|
|
} |
1693
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1694
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1695
|
|
|
|
|
|
|
|
1696
|
|
|
|
|
|
|
void |
1697
|
|
|
|
|
|
|
sub_c_pv (rop, op1, op2) |
1698
|
|
|
|
|
|
|
SV * rop |
1699
|
|
|
|
|
|
|
SV * op1 |
1700
|
|
|
|
|
|
|
SV * op2 |
1701
|
|
|
|
|
|
|
PREINIT: |
1702
|
|
|
|
|
|
|
I32* temp; |
1703
|
|
|
|
|
|
|
PPCODE: |
1704
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1705
|
1
|
|
|
|
|
|
sub_c_pv(aTHX_ rop, op1, op2); |
1706
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1707
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1708
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1709
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1710
|
|
|
|
|
|
|
} |
1711
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1712
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1713
|
|
|
|
|
|
|
|
1714
|
|
|
|
|
|
|
void |
1715
|
|
|
|
|
|
|
DESTROY (op) |
1716
|
|
|
|
|
|
|
SV * op |
1717
|
|
|
|
|
|
|
PREINIT: |
1718
|
|
|
|
|
|
|
I32* temp; |
1719
|
|
|
|
|
|
|
PPCODE: |
1720
|
126
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1721
|
126
|
|
|
|
|
|
DESTROY(aTHX_ op); |
1722
|
126
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1723
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1724
|
126
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1725
|
126
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1726
|
|
|
|
|
|
|
} |
1727
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1728
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1729
|
|
|
|
|
|
|
|
1730
|
|
|
|
|
|
|
SV * |
1731
|
|
|
|
|
|
|
real_c (op) |
1732
|
|
|
|
|
|
|
SV * op |
1733
|
|
|
|
|
|
|
CODE: |
1734
|
78
|
|
|
|
|
|
RETVAL = real_c (aTHX_ op); |
1735
|
|
|
|
|
|
|
OUTPUT: RETVAL |
1736
|
|
|
|
|
|
|
|
1737
|
|
|
|
|
|
|
SV * |
1738
|
|
|
|
|
|
|
imag_c (op) |
1739
|
|
|
|
|
|
|
SV * op |
1740
|
|
|
|
|
|
|
CODE: |
1741
|
58
|
|
|
|
|
|
RETVAL = imag_c (aTHX_ op); |
1742
|
|
|
|
|
|
|
OUTPUT: RETVAL |
1743
|
|
|
|
|
|
|
|
1744
|
|
|
|
|
|
|
SV * |
1745
|
|
|
|
|
|
|
arg_c (op) |
1746
|
|
|
|
|
|
|
SV * op |
1747
|
|
|
|
|
|
|
CODE: |
1748
|
1
|
|
|
|
|
|
RETVAL = arg_c (aTHX_ op); |
1749
|
|
|
|
|
|
|
OUTPUT: RETVAL |
1750
|
|
|
|
|
|
|
|
1751
|
|
|
|
|
|
|
SV * |
1752
|
|
|
|
|
|
|
abs_c (op) |
1753
|
|
|
|
|
|
|
SV * op |
1754
|
|
|
|
|
|
|
CODE: |
1755
|
1
|
|
|
|
|
|
RETVAL = abs_c (aTHX_ op); |
1756
|
|
|
|
|
|
|
OUTPUT: RETVAL |
1757
|
|
|
|
|
|
|
|
1758
|
|
|
|
|
|
|
void |
1759
|
|
|
|
|
|
|
conj_c (rop, op) |
1760
|
|
|
|
|
|
|
SV * rop |
1761
|
|
|
|
|
|
|
SV * op |
1762
|
|
|
|
|
|
|
PREINIT: |
1763
|
|
|
|
|
|
|
I32* temp; |
1764
|
|
|
|
|
|
|
PPCODE: |
1765
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1766
|
1
|
|
|
|
|
|
conj_c(aTHX_ rop, op); |
1767
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1768
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1769
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1770
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1771
|
|
|
|
|
|
|
} |
1772
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1773
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1774
|
|
|
|
|
|
|
|
1775
|
|
|
|
|
|
|
void |
1776
|
|
|
|
|
|
|
acos_c (rop, op) |
1777
|
|
|
|
|
|
|
SV * rop |
1778
|
|
|
|
|
|
|
SV * op |
1779
|
|
|
|
|
|
|
PREINIT: |
1780
|
|
|
|
|
|
|
I32* temp; |
1781
|
|
|
|
|
|
|
PPCODE: |
1782
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1783
|
1
|
|
|
|
|
|
acos_c(aTHX_ rop, op); |
1784
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1785
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1786
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1787
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1788
|
|
|
|
|
|
|
} |
1789
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1790
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1791
|
|
|
|
|
|
|
|
1792
|
|
|
|
|
|
|
void |
1793
|
|
|
|
|
|
|
asin_c (rop, op) |
1794
|
|
|
|
|
|
|
SV * rop |
1795
|
|
|
|
|
|
|
SV * op |
1796
|
|
|
|
|
|
|
PREINIT: |
1797
|
|
|
|
|
|
|
I32* temp; |
1798
|
|
|
|
|
|
|
PPCODE: |
1799
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1800
|
1
|
|
|
|
|
|
asin_c(aTHX_ rop, op); |
1801
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1802
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1803
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1804
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1805
|
|
|
|
|
|
|
} |
1806
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1807
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1808
|
|
|
|
|
|
|
|
1809
|
|
|
|
|
|
|
void |
1810
|
|
|
|
|
|
|
atan_c (rop, op) |
1811
|
|
|
|
|
|
|
SV * rop |
1812
|
|
|
|
|
|
|
SV * op |
1813
|
|
|
|
|
|
|
PREINIT: |
1814
|
|
|
|
|
|
|
I32* temp; |
1815
|
|
|
|
|
|
|
PPCODE: |
1816
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1817
|
1
|
|
|
|
|
|
atan_c(aTHX_ rop, op); |
1818
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1819
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1820
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1821
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1822
|
|
|
|
|
|
|
} |
1823
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1824
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1825
|
|
|
|
|
|
|
|
1826
|
|
|
|
|
|
|
void |
1827
|
|
|
|
|
|
|
cos_c (rop, op) |
1828
|
|
|
|
|
|
|
SV * rop |
1829
|
|
|
|
|
|
|
SV * op |
1830
|
|
|
|
|
|
|
PREINIT: |
1831
|
|
|
|
|
|
|
I32* temp; |
1832
|
|
|
|
|
|
|
PPCODE: |
1833
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1834
|
1
|
|
|
|
|
|
cos_c(aTHX_ rop, op); |
1835
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1836
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1837
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1838
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1839
|
|
|
|
|
|
|
} |
1840
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1841
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1842
|
|
|
|
|
|
|
|
1843
|
|
|
|
|
|
|
void |
1844
|
|
|
|
|
|
|
sin_c (rop, op) |
1845
|
|
|
|
|
|
|
SV * rop |
1846
|
|
|
|
|
|
|
SV * op |
1847
|
|
|
|
|
|
|
PREINIT: |
1848
|
|
|
|
|
|
|
I32* temp; |
1849
|
|
|
|
|
|
|
PPCODE: |
1850
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1851
|
1
|
|
|
|
|
|
sin_c(aTHX_ rop, op); |
1852
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1853
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1854
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1855
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1856
|
|
|
|
|
|
|
} |
1857
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1858
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1859
|
|
|
|
|
|
|
|
1860
|
|
|
|
|
|
|
void |
1861
|
|
|
|
|
|
|
tan_c (rop, op) |
1862
|
|
|
|
|
|
|
SV * rop |
1863
|
|
|
|
|
|
|
SV * op |
1864
|
|
|
|
|
|
|
PREINIT: |
1865
|
|
|
|
|
|
|
I32* temp; |
1866
|
|
|
|
|
|
|
PPCODE: |
1867
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1868
|
1
|
|
|
|
|
|
tan_c(aTHX_ rop, op); |
1869
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1870
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1871
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1872
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1873
|
|
|
|
|
|
|
} |
1874
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1875
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1876
|
|
|
|
|
|
|
|
1877
|
|
|
|
|
|
|
void |
1878
|
|
|
|
|
|
|
acosh_c (rop, op) |
1879
|
|
|
|
|
|
|
SV * rop |
1880
|
|
|
|
|
|
|
SV * op |
1881
|
|
|
|
|
|
|
PREINIT: |
1882
|
|
|
|
|
|
|
I32* temp; |
1883
|
|
|
|
|
|
|
PPCODE: |
1884
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1885
|
1
|
|
|
|
|
|
acosh_c(aTHX_ rop, op); |
1886
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1887
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1888
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1889
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1890
|
|
|
|
|
|
|
} |
1891
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1892
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1893
|
|
|
|
|
|
|
|
1894
|
|
|
|
|
|
|
void |
1895
|
|
|
|
|
|
|
asinh_c (rop, op) |
1896
|
|
|
|
|
|
|
SV * rop |
1897
|
|
|
|
|
|
|
SV * op |
1898
|
|
|
|
|
|
|
PREINIT: |
1899
|
|
|
|
|
|
|
I32* temp; |
1900
|
|
|
|
|
|
|
PPCODE: |
1901
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1902
|
1
|
|
|
|
|
|
asinh_c(aTHX_ rop, op); |
1903
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1904
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1905
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1906
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1907
|
|
|
|
|
|
|
} |
1908
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1909
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1910
|
|
|
|
|
|
|
|
1911
|
|
|
|
|
|
|
void |
1912
|
|
|
|
|
|
|
atanh_c (rop, op) |
1913
|
|
|
|
|
|
|
SV * rop |
1914
|
|
|
|
|
|
|
SV * op |
1915
|
|
|
|
|
|
|
PREINIT: |
1916
|
|
|
|
|
|
|
I32* temp; |
1917
|
|
|
|
|
|
|
PPCODE: |
1918
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1919
|
1
|
|
|
|
|
|
atanh_c(aTHX_ rop, op); |
1920
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1921
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1922
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1923
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1924
|
|
|
|
|
|
|
} |
1925
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1926
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1927
|
|
|
|
|
|
|
|
1928
|
|
|
|
|
|
|
void |
1929
|
|
|
|
|
|
|
cosh_c (rop, op) |
1930
|
|
|
|
|
|
|
SV * rop |
1931
|
|
|
|
|
|
|
SV * op |
1932
|
|
|
|
|
|
|
PREINIT: |
1933
|
|
|
|
|
|
|
I32* temp; |
1934
|
|
|
|
|
|
|
PPCODE: |
1935
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1936
|
1
|
|
|
|
|
|
cosh_c(aTHX_ rop, op); |
1937
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1938
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1939
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1940
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1941
|
|
|
|
|
|
|
} |
1942
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1943
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1944
|
|
|
|
|
|
|
|
1945
|
|
|
|
|
|
|
void |
1946
|
|
|
|
|
|
|
sinh_c (rop, op) |
1947
|
|
|
|
|
|
|
SV * rop |
1948
|
|
|
|
|
|
|
SV * op |
1949
|
|
|
|
|
|
|
PREINIT: |
1950
|
|
|
|
|
|
|
I32* temp; |
1951
|
|
|
|
|
|
|
PPCODE: |
1952
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1953
|
1
|
|
|
|
|
|
sinh_c(aTHX_ rop, op); |
1954
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1955
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1956
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1957
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1958
|
|
|
|
|
|
|
} |
1959
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1960
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1961
|
|
|
|
|
|
|
|
1962
|
|
|
|
|
|
|
void |
1963
|
|
|
|
|
|
|
tanh_c (rop, op) |
1964
|
|
|
|
|
|
|
SV * rop |
1965
|
|
|
|
|
|
|
SV * op |
1966
|
|
|
|
|
|
|
PREINIT: |
1967
|
|
|
|
|
|
|
I32* temp; |
1968
|
|
|
|
|
|
|
PPCODE: |
1969
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1970
|
1
|
|
|
|
|
|
tanh_c(aTHX_ rop, op); |
1971
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1972
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1973
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1974
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1975
|
|
|
|
|
|
|
} |
1976
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1977
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1978
|
|
|
|
|
|
|
|
1979
|
|
|
|
|
|
|
void |
1980
|
|
|
|
|
|
|
exp_c (rop, op) |
1981
|
|
|
|
|
|
|
SV * rop |
1982
|
|
|
|
|
|
|
SV * op |
1983
|
|
|
|
|
|
|
PREINIT: |
1984
|
|
|
|
|
|
|
I32* temp; |
1985
|
|
|
|
|
|
|
PPCODE: |
1986
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
1987
|
1
|
|
|
|
|
|
exp_c(aTHX_ rop, op); |
1988
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
1989
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
1990
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
1991
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
1992
|
|
|
|
|
|
|
} |
1993
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
1994
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
1995
|
|
|
|
|
|
|
|
1996
|
|
|
|
|
|
|
void |
1997
|
|
|
|
|
|
|
log_c (rop, op) |
1998
|
|
|
|
|
|
|
SV * rop |
1999
|
|
|
|
|
|
|
SV * op |
2000
|
|
|
|
|
|
|
PREINIT: |
2001
|
|
|
|
|
|
|
I32* temp; |
2002
|
|
|
|
|
|
|
PPCODE: |
2003
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
2004
|
1
|
|
|
|
|
|
log_c(aTHX_ rop, op); |
2005
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
2006
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
2007
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
2008
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
2009
|
|
|
|
|
|
|
} |
2010
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
2011
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
2012
|
|
|
|
|
|
|
|
2013
|
|
|
|
|
|
|
void |
2014
|
|
|
|
|
|
|
sqrt_c (rop, op) |
2015
|
|
|
|
|
|
|
SV * rop |
2016
|
|
|
|
|
|
|
SV * op |
2017
|
|
|
|
|
|
|
PREINIT: |
2018
|
|
|
|
|
|
|
I32* temp; |
2019
|
|
|
|
|
|
|
PPCODE: |
2020
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
2021
|
1
|
|
|
|
|
|
sqrt_c(aTHX_ rop, op); |
2022
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
2023
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
2024
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
2025
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
2026
|
|
|
|
|
|
|
} |
2027
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
2028
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
2029
|
|
|
|
|
|
|
|
2030
|
|
|
|
|
|
|
void |
2031
|
|
|
|
|
|
|
proj_c (rop, op) |
2032
|
|
|
|
|
|
|
SV * rop |
2033
|
|
|
|
|
|
|
SV * op |
2034
|
|
|
|
|
|
|
PREINIT: |
2035
|
|
|
|
|
|
|
I32* temp; |
2036
|
|
|
|
|
|
|
PPCODE: |
2037
|
6
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
2038
|
6
|
|
|
|
|
|
proj_c(aTHX_ rop, op); |
2039
|
6
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
2040
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
2041
|
6
|
|
|
|
|
|
PL_markstack_ptr = temp; |
2042
|
6
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
2043
|
|
|
|
|
|
|
} |
2044
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
2045
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
2046
|
|
|
|
|
|
|
|
2047
|
|
|
|
|
|
|
void |
2048
|
|
|
|
|
|
|
pow_c (rop, op, exp) |
2049
|
|
|
|
|
|
|
SV * rop |
2050
|
|
|
|
|
|
|
SV * op |
2051
|
|
|
|
|
|
|
SV * exp |
2052
|
|
|
|
|
|
|
PREINIT: |
2053
|
|
|
|
|
|
|
I32* temp; |
2054
|
|
|
|
|
|
|
PPCODE: |
2055
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
2056
|
1
|
|
|
|
|
|
pow_c(aTHX_ rop, op, exp); |
2057
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
2058
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
2059
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
2060
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
2061
|
|
|
|
|
|
|
} |
2062
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
2063
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
2064
|
|
|
|
|
|
|
|
2065
|
|
|
|
|
|
|
SV * |
2066
|
|
|
|
|
|
|
_overload_true (rop, second, third) |
2067
|
|
|
|
|
|
|
SV * rop |
2068
|
|
|
|
|
|
|
SV * second |
2069
|
|
|
|
|
|
|
SV * third |
2070
|
|
|
|
|
|
|
CODE: |
2071
|
4
|
|
|
|
|
|
RETVAL = _overload_true (aTHX_ rop, second, third); |
2072
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2073
|
|
|
|
|
|
|
|
2074
|
|
|
|
|
|
|
SV * |
2075
|
|
|
|
|
|
|
_overload_not (rop, second, third) |
2076
|
|
|
|
|
|
|
SV * rop |
2077
|
|
|
|
|
|
|
SV * second |
2078
|
|
|
|
|
|
|
SV * third |
2079
|
|
|
|
|
|
|
CODE: |
2080
|
8
|
|
|
|
|
|
RETVAL = _overload_not (aTHX_ rop, second, third); |
2081
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2082
|
|
|
|
|
|
|
|
2083
|
|
|
|
|
|
|
SV * |
2084
|
|
|
|
|
|
|
_overload_equiv (a, b, third) |
2085
|
|
|
|
|
|
|
SV * a |
2086
|
|
|
|
|
|
|
SV * b |
2087
|
|
|
|
|
|
|
SV * third |
2088
|
|
|
|
|
|
|
CODE: |
2089
|
41
|
|
|
|
|
|
RETVAL = _overload_equiv (aTHX_ a, b, third); |
2090
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2091
|
|
|
|
|
|
|
|
2092
|
|
|
|
|
|
|
SV * |
2093
|
|
|
|
|
|
|
_overload_not_equiv (a, b, third) |
2094
|
|
|
|
|
|
|
SV * a |
2095
|
|
|
|
|
|
|
SV * b |
2096
|
|
|
|
|
|
|
SV * third |
2097
|
|
|
|
|
|
|
CODE: |
2098
|
5
|
|
|
|
|
|
RETVAL = _overload_not_equiv (aTHX_ a, b, third); |
2099
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2100
|
|
|
|
|
|
|
|
2101
|
|
|
|
|
|
|
SV * |
2102
|
|
|
|
|
|
|
_overload_pow (a, b, third) |
2103
|
|
|
|
|
|
|
SV * a |
2104
|
|
|
|
|
|
|
SV * b |
2105
|
|
|
|
|
|
|
SV * third |
2106
|
|
|
|
|
|
|
CODE: |
2107
|
17
|
|
|
|
|
|
RETVAL = _overload_pow (aTHX_ a, b, third); |
2108
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2109
|
|
|
|
|
|
|
|
2110
|
|
|
|
|
|
|
SV * |
2111
|
|
|
|
|
|
|
_overload_mul (a, b, third) |
2112
|
|
|
|
|
|
|
SV * a |
2113
|
|
|
|
|
|
|
SV * b |
2114
|
|
|
|
|
|
|
SV * third |
2115
|
|
|
|
|
|
|
CODE: |
2116
|
5
|
|
|
|
|
|
RETVAL = _overload_mul (aTHX_ a, b, third); |
2117
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2118
|
|
|
|
|
|
|
|
2119
|
|
|
|
|
|
|
SV * |
2120
|
|
|
|
|
|
|
_overload_add (a, b, third) |
2121
|
|
|
|
|
|
|
SV * a |
2122
|
|
|
|
|
|
|
SV * b |
2123
|
|
|
|
|
|
|
SV * third |
2124
|
|
|
|
|
|
|
CODE: |
2125
|
5
|
|
|
|
|
|
RETVAL = _overload_add (aTHX_ a, b, third); |
2126
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2127
|
|
|
|
|
|
|
|
2128
|
|
|
|
|
|
|
SV * |
2129
|
|
|
|
|
|
|
_overload_div (a, b, third) |
2130
|
|
|
|
|
|
|
SV * a |
2131
|
|
|
|
|
|
|
SV * b |
2132
|
|
|
|
|
|
|
SV * third |
2133
|
|
|
|
|
|
|
CODE: |
2134
|
9
|
|
|
|
|
|
RETVAL = _overload_div (aTHX_ a, b, third); |
2135
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2136
|
|
|
|
|
|
|
|
2137
|
|
|
|
|
|
|
SV * |
2138
|
|
|
|
|
|
|
_overload_sub (a, b, third) |
2139
|
|
|
|
|
|
|
SV * a |
2140
|
|
|
|
|
|
|
SV * b |
2141
|
|
|
|
|
|
|
SV * third |
2142
|
|
|
|
|
|
|
CODE: |
2143
|
8
|
|
|
|
|
|
RETVAL = _overload_sub (aTHX_ a, b, third); |
2144
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2145
|
|
|
|
|
|
|
|
2146
|
|
|
|
|
|
|
SV * |
2147
|
|
|
|
|
|
|
_overload_sqrt (a, b, third) |
2148
|
|
|
|
|
|
|
SV * a |
2149
|
|
|
|
|
|
|
SV * b |
2150
|
|
|
|
|
|
|
SV * third |
2151
|
|
|
|
|
|
|
CODE: |
2152
|
1
|
|
|
|
|
|
RETVAL = _overload_sqrt (aTHX_ a, b, third); |
2153
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2154
|
|
|
|
|
|
|
|
2155
|
|
|
|
|
|
|
SV * |
2156
|
|
|
|
|
|
|
_overload_pow_eq (a, b, third) |
2157
|
|
|
|
|
|
|
SV * a |
2158
|
|
|
|
|
|
|
SV * b |
2159
|
|
|
|
|
|
|
SV * third |
2160
|
|
|
|
|
|
|
CODE: |
2161
|
4
|
|
|
|
|
|
RETVAL = _overload_pow_eq (aTHX_ a, b, third); |
2162
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2163
|
|
|
|
|
|
|
|
2164
|
|
|
|
|
|
|
SV * |
2165
|
|
|
|
|
|
|
_overload_mul_eq (a, b, third) |
2166
|
|
|
|
|
|
|
SV * a |
2167
|
|
|
|
|
|
|
SV * b |
2168
|
|
|
|
|
|
|
SV * third |
2169
|
|
|
|
|
|
|
CODE: |
2170
|
7
|
|
|
|
|
|
RETVAL = _overload_mul_eq (aTHX_ a, b, third); |
2171
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2172
|
|
|
|
|
|
|
|
2173
|
|
|
|
|
|
|
SV * |
2174
|
|
|
|
|
|
|
_overload_add_eq (a, b, third) |
2175
|
|
|
|
|
|
|
SV * a |
2176
|
|
|
|
|
|
|
SV * b |
2177
|
|
|
|
|
|
|
SV * third |
2178
|
|
|
|
|
|
|
CODE: |
2179
|
6
|
|
|
|
|
|
RETVAL = _overload_add_eq (aTHX_ a, b, third); |
2180
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2181
|
|
|
|
|
|
|
|
2182
|
|
|
|
|
|
|
SV * |
2183
|
|
|
|
|
|
|
_overload_div_eq (a, b, third) |
2184
|
|
|
|
|
|
|
SV * a |
2185
|
|
|
|
|
|
|
SV * b |
2186
|
|
|
|
|
|
|
SV * third |
2187
|
|
|
|
|
|
|
CODE: |
2188
|
5
|
|
|
|
|
|
RETVAL = _overload_div_eq (aTHX_ a, b, third); |
2189
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2190
|
|
|
|
|
|
|
|
2191
|
|
|
|
|
|
|
SV * |
2192
|
|
|
|
|
|
|
_overload_sub_eq (a, b, third) |
2193
|
|
|
|
|
|
|
SV * a |
2194
|
|
|
|
|
|
|
SV * b |
2195
|
|
|
|
|
|
|
SV * third |
2196
|
|
|
|
|
|
|
CODE: |
2197
|
5
|
|
|
|
|
|
RETVAL = _overload_sub_eq (aTHX_ a, b, third); |
2198
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2199
|
|
|
|
|
|
|
|
2200
|
|
|
|
|
|
|
SV * |
2201
|
|
|
|
|
|
|
_overload_copy (a, second, third) |
2202
|
|
|
|
|
|
|
SV * a |
2203
|
|
|
|
|
|
|
SV * second |
2204
|
|
|
|
|
|
|
SV * third |
2205
|
|
|
|
|
|
|
CODE: |
2206
|
4
|
|
|
|
|
|
RETVAL = _overload_copy (aTHX_ a, second, third); |
2207
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2208
|
|
|
|
|
|
|
|
2209
|
|
|
|
|
|
|
SV * |
2210
|
|
|
|
|
|
|
_overload_abs (rop, second, third) |
2211
|
|
|
|
|
|
|
SV * rop |
2212
|
|
|
|
|
|
|
SV * second |
2213
|
|
|
|
|
|
|
SV * third |
2214
|
|
|
|
|
|
|
CODE: |
2215
|
1
|
|
|
|
|
|
RETVAL = _overload_abs (aTHX_ rop, second, third); |
2216
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2217
|
|
|
|
|
|
|
|
2218
|
|
|
|
|
|
|
SV * |
2219
|
|
|
|
|
|
|
_overload_exp (a, b, third) |
2220
|
|
|
|
|
|
|
SV * a |
2221
|
|
|
|
|
|
|
SV * b |
2222
|
|
|
|
|
|
|
SV * third |
2223
|
|
|
|
|
|
|
CODE: |
2224
|
1
|
|
|
|
|
|
RETVAL = _overload_exp (aTHX_ a, b, third); |
2225
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2226
|
|
|
|
|
|
|
|
2227
|
|
|
|
|
|
|
SV * |
2228
|
|
|
|
|
|
|
_overload_log (a, b, third) |
2229
|
|
|
|
|
|
|
SV * a |
2230
|
|
|
|
|
|
|
SV * b |
2231
|
|
|
|
|
|
|
SV * third |
2232
|
|
|
|
|
|
|
CODE: |
2233
|
1
|
|
|
|
|
|
RETVAL = _overload_log (aTHX_ a, b, third); |
2234
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2235
|
|
|
|
|
|
|
|
2236
|
|
|
|
|
|
|
SV * |
2237
|
|
|
|
|
|
|
_overload_sin (a, b, third) |
2238
|
|
|
|
|
|
|
SV * a |
2239
|
|
|
|
|
|
|
SV * b |
2240
|
|
|
|
|
|
|
SV * third |
2241
|
|
|
|
|
|
|
CODE: |
2242
|
1
|
|
|
|
|
|
RETVAL = _overload_sin (aTHX_ a, b, third); |
2243
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2244
|
|
|
|
|
|
|
|
2245
|
|
|
|
|
|
|
SV * |
2246
|
|
|
|
|
|
|
_overload_cos (a, b, third) |
2247
|
|
|
|
|
|
|
SV * a |
2248
|
|
|
|
|
|
|
SV * b |
2249
|
|
|
|
|
|
|
SV * third |
2250
|
|
|
|
|
|
|
CODE: |
2251
|
1
|
|
|
|
|
|
RETVAL = _overload_cos (aTHX_ a, b, third); |
2252
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2253
|
|
|
|
|
|
|
|
2254
|
|
|
|
|
|
|
SV * |
2255
|
|
|
|
|
|
|
_overload_atan2 (a, b, third) |
2256
|
|
|
|
|
|
|
SV * a |
2257
|
|
|
|
|
|
|
SV * b |
2258
|
|
|
|
|
|
|
SV * third |
2259
|
|
|
|
|
|
|
CODE: |
2260
|
1
|
|
|
|
|
|
RETVAL = _overload_atan2 (aTHX_ a, b, third); |
2261
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2262
|
|
|
|
|
|
|
|
2263
|
|
|
|
|
|
|
SV * |
2264
|
|
|
|
|
|
|
get_nan () |
2265
|
|
|
|
|
|
|
CODE: |
2266
|
4
|
|
|
|
|
|
RETVAL = get_nan (aTHX); |
2267
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2268
|
|
|
|
|
|
|
|
2269
|
|
|
|
|
|
|
|
2270
|
|
|
|
|
|
|
SV * |
2271
|
|
|
|
|
|
|
get_inf () |
2272
|
|
|
|
|
|
|
CODE: |
2273
|
2
|
|
|
|
|
|
RETVAL = get_inf (aTHX); |
2274
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2275
|
|
|
|
|
|
|
|
2276
|
|
|
|
|
|
|
|
2277
|
|
|
|
|
|
|
SV * |
2278
|
|
|
|
|
|
|
get_neg_inf () |
2279
|
|
|
|
|
|
|
CODE: |
2280
|
0
|
|
|
|
|
|
RETVAL = get_neg_inf (aTHX); |
2281
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2282
|
|
|
|
|
|
|
|
2283
|
|
|
|
|
|
|
|
2284
|
|
|
|
|
|
|
SV * |
2285
|
|
|
|
|
|
|
is_nan (a) |
2286
|
|
|
|
|
|
|
SV * a |
2287
|
|
|
|
|
|
|
CODE: |
2288
|
1
|
|
|
|
|
|
RETVAL = is_nan (aTHX_ a); |
2289
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2290
|
|
|
|
|
|
|
|
2291
|
|
|
|
|
|
|
SV * |
2292
|
|
|
|
|
|
|
is_inf (a) |
2293
|
|
|
|
|
|
|
SV * a |
2294
|
|
|
|
|
|
|
CODE: |
2295
|
6
|
|
|
|
|
|
RETVAL = is_inf (aTHX_ a); |
2296
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2297
|
|
|
|
|
|
|
|
2298
|
|
|
|
|
|
|
SV * |
2299
|
|
|
|
|
|
|
_complex_type () |
2300
|
|
|
|
|
|
|
CODE: |
2301
|
0
|
|
|
|
|
|
RETVAL = _complex_type (aTHX); |
2302
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2303
|
|
|
|
|
|
|
|
2304
|
|
|
|
|
|
|
|
2305
|
|
|
|
|
|
|
SV * |
2306
|
|
|
|
|
|
|
_double_type () |
2307
|
|
|
|
|
|
|
CODE: |
2308
|
0
|
|
|
|
|
|
RETVAL = _double_type (aTHX); |
2309
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2310
|
|
|
|
|
|
|
|
2311
|
|
|
|
|
|
|
|
2312
|
|
|
|
|
|
|
SV * |
2313
|
|
|
|
|
|
|
_get_nv (x) |
2314
|
|
|
|
|
|
|
SV * x |
2315
|
|
|
|
|
|
|
CODE: |
2316
|
0
|
|
|
|
|
|
RETVAL = _get_nv (aTHX_ x); |
2317
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2318
|
|
|
|
|
|
|
|
2319
|
|
|
|
|
|
|
SV * |
2320
|
|
|
|
|
|
|
_which_package (b) |
2321
|
|
|
|
|
|
|
SV * b |
2322
|
|
|
|
|
|
|
CODE: |
2323
|
0
|
|
|
|
|
|
RETVAL = _which_package (aTHX_ b); |
2324
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2325
|
|
|
|
|
|
|
|
2326
|
|
|
|
|
|
|
SV * |
2327
|
|
|
|
|
|
|
_wrap_count () |
2328
|
|
|
|
|
|
|
CODE: |
2329
|
0
|
|
|
|
|
|
RETVAL = _wrap_count (aTHX); |
2330
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2331
|
|
|
|
|
|
|
|
2332
|
|
|
|
|
|
|
|
2333
|
|
|
|
|
|
|
SV * |
2334
|
|
|
|
|
|
|
_ivsize () |
2335
|
|
|
|
|
|
|
CODE: |
2336
|
0
|
|
|
|
|
|
RETVAL = _ivsize (aTHX); |
2337
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2338
|
|
|
|
|
|
|
|
2339
|
|
|
|
|
|
|
|
2340
|
|
|
|
|
|
|
SV * |
2341
|
|
|
|
|
|
|
_nvsize () |
2342
|
|
|
|
|
|
|
CODE: |
2343
|
0
|
|
|
|
|
|
RETVAL = _nvsize (aTHX); |
2344
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2345
|
|
|
|
|
|
|
|
2346
|
|
|
|
|
|
|
|
2347
|
|
|
|
|
|
|
SV * |
2348
|
|
|
|
|
|
|
_doublesize () |
2349
|
|
|
|
|
|
|
CODE: |
2350
|
0
|
|
|
|
|
|
RETVAL = _doublesize (aTHX); |
2351
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2352
|
|
|
|
|
|
|
|
2353
|
|
|
|
|
|
|
|
2354
|
|
|
|
|
|
|
SV * |
2355
|
|
|
|
|
|
|
_longdoublesize () |
2356
|
|
|
|
|
|
|
CODE: |
2357
|
0
|
|
|
|
|
|
RETVAL = _longdoublesize (aTHX); |
2358
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2359
|
|
|
|
|
|
|
|
2360
|
|
|
|
|
|
|
|
2361
|
|
|
|
|
|
|
SV * |
2362
|
|
|
|
|
|
|
_double_Complexsize () |
2363
|
|
|
|
|
|
|
CODE: |
2364
|
0
|
|
|
|
|
|
RETVAL = _double_Complexsize (aTHX); |
2365
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2366
|
|
|
|
|
|
|
|
2367
|
|
|
|
|
|
|
|
2368
|
|
|
|
|
|
|
SV * |
2369
|
|
|
|
|
|
|
_longdouble_Complexsize () |
2370
|
|
|
|
|
|
|
CODE: |
2371
|
0
|
|
|
|
|
|
RETVAL = _longdouble_Complexsize (aTHX); |
2372
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2373
|
|
|
|
|
|
|
|
2374
|
|
|
|
|
|
|
|
2375
|
|
|
|
|
|
|
void |
2376
|
|
|
|
|
|
|
_d_to_str (ld) |
2377
|
|
|
|
|
|
|
SV * ld |
2378
|
|
|
|
|
|
|
PREINIT: |
2379
|
|
|
|
|
|
|
I32* temp; |
2380
|
|
|
|
|
|
|
PPCODE: |
2381
|
10
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
2382
|
10
|
|
|
|
|
|
_d_to_str(aTHX_ ld); |
2383
|
10
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
2384
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
2385
|
0
|
|
|
|
|
|
PL_markstack_ptr = temp; |
2386
|
0
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
2387
|
|
|
|
|
|
|
} |
2388
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
2389
|
10
|
|
|
|
|
|
return; /* assume stack size is correct */ |
2390
|
|
|
|
|
|
|
|
2391
|
|
|
|
|
|
|
void |
2392
|
|
|
|
|
|
|
_d_to_strp (ld, decimal_prec) |
2393
|
|
|
|
|
|
|
SV * ld |
2394
|
|
|
|
|
|
|
int decimal_prec |
2395
|
|
|
|
|
|
|
PREINIT: |
2396
|
|
|
|
|
|
|
I32* temp; |
2397
|
|
|
|
|
|
|
PPCODE: |
2398
|
3
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
2399
|
3
|
|
|
|
|
|
_d_to_strp(aTHX_ ld, decimal_prec); |
2400
|
3
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
2401
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
2402
|
0
|
|
|
|
|
|
PL_markstack_ptr = temp; |
2403
|
0
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
2404
|
|
|
|
|
|
|
} |
2405
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
2406
|
3
|
|
|
|
|
|
return; /* assume stack size is correct */ |
2407
|
|
|
|
|
|
|
|
2408
|
|
|
|
|
|
|
SV * |
2409
|
|
|
|
|
|
|
_LDBL_DIG () |
2410
|
|
|
|
|
|
|
CODE: |
2411
|
0
|
|
|
|
|
|
RETVAL = _LDBL_DIG (aTHX); |
2412
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2413
|
|
|
|
|
|
|
|
2414
|
|
|
|
|
|
|
|
2415
|
|
|
|
|
|
|
SV * |
2416
|
|
|
|
|
|
|
_DBL_DIG () |
2417
|
|
|
|
|
|
|
CODE: |
2418
|
0
|
|
|
|
|
|
RETVAL = _DBL_DIG (aTHX); |
2419
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2420
|
|
|
|
|
|
|
|
2421
|
|
|
|
|
|
|
|
2422
|
|
|
|
|
|
|
SV * |
2423
|
|
|
|
|
|
|
_get_xs_version () |
2424
|
|
|
|
|
|
|
CODE: |
2425
|
0
|
|
|
|
|
|
RETVAL = _get_xs_version (aTHX); |
2426
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2427
|
|
|
|
|
|
|
|
2428
|
|
|
|
|
|
|
|
2429
|
|
|
|
|
|
|
SV * |
2430
|
|
|
|
|
|
|
_itsa (a) |
2431
|
|
|
|
|
|
|
SV * a |
2432
|
|
|
|
|
|
|
CODE: |
2433
|
16
|
|
|
|
|
|
RETVAL = _itsa (aTHX_ a); |
2434
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2435
|
|
|
|
|
|
|
|
2436
|
|
|
|
|
|
|
int |
2437
|
|
|
|
|
|
|
nnumflag () |
2438
|
|
|
|
|
|
|
|
2439
|
|
|
|
|
|
|
|
2440
|
|
|
|
|
|
|
void |
2441
|
|
|
|
|
|
|
clear_nnum () |
2442
|
|
|
|
|
|
|
|
2443
|
|
|
|
|
|
|
PREINIT: |
2444
|
|
|
|
|
|
|
I32* temp; |
2445
|
|
|
|
|
|
|
PPCODE: |
2446
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
2447
|
1
|
|
|
|
|
|
clear_nnum(); |
2448
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
2449
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
2450
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
2451
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
2452
|
|
|
|
|
|
|
} |
2453
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
2454
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
2455
|
|
|
|
|
|
|
|
2456
|
|
|
|
|
|
|
void |
2457
|
|
|
|
|
|
|
set_nnum (x) |
2458
|
|
|
|
|
|
|
int x |
2459
|
|
|
|
|
|
|
PREINIT: |
2460
|
|
|
|
|
|
|
I32* temp; |
2461
|
|
|
|
|
|
|
PPCODE: |
2462
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
2463
|
1
|
|
|
|
|
|
set_nnum(x); |
2464
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
2465
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
2466
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
2467
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
2468
|
|
|
|
|
|
|
} |
2469
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
2470
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
2471
|
|
|
|
|
|
|
|
2472
|
|
|
|
|
|
|
int |
2473
|
|
|
|
|
|
|
_lln (x) |
2474
|
|
|
|
|
|
|
SV * x |
2475
|
|
|
|
|
|
|
CODE: |
2476
|
0
|
|
|
|
|
|
RETVAL = _lln (aTHX_ x); |
2477
|
|
|
|
|
|
|
OUTPUT: RETVAL |
2478
|
|
|
|
|
|
|
|