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