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_float128_include.h" |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
int nnum = 0; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
int nok_pok = 0; /* flag that is incremented whenever a scalar that is both |
20
|
|
|
|
|
|
|
NOK and POK is passed to new or an overloaded operator */ |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
int NOK_POK_val(pTHX) { |
23
|
|
|
|
|
|
|
/* return the numeric value of $Math::MPFR::NOK_POK */ |
24
|
0
|
0
|
|
|
|
|
return SvIV(get_sv("Math::Float128::NOK_POK", 0)); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
int _win32_infnanstring(char * s) { /* MS Windows only - detect 1.#INF and 1.#IND |
28
|
|
|
|
|
|
|
* Need to do this to correctly handle a scalar |
29
|
|
|
|
|
|
|
* that is both NOK and POK on older win32 perls */ |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
/************************************* |
32
|
|
|
|
|
|
|
* if input string =~ /^\-1\.#INF$/ return -1 |
33
|
|
|
|
|
|
|
* elsif input string =~ /^\+?1\.#INF$/i return 1 |
34
|
|
|
|
|
|
|
* elsif input string =~ /^(\-|\+)?1\.#IND$/i return 2 |
35
|
|
|
|
|
|
|
* else return 0 |
36
|
|
|
|
|
|
|
**************************************/ |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
int sign = 1; |
41
|
|
|
|
|
|
|
int factor = 1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
if(s[0] == '-') { |
44
|
|
|
|
|
|
|
sign = -1; |
45
|
|
|
|
|
|
|
s++; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
else { |
48
|
|
|
|
|
|
|
if(s[0] == '+') s++; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
if(!strcmp(s, "1.#INF")) return sign; |
52
|
|
|
|
|
|
|
if(!strcmp(s, "1.#IND")) return 2; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
return 0; |
55
|
|
|
|
|
|
|
#else |
56
|
0
|
|
|
|
|
|
croak("Math::Float128::_win32_infnanstring not implemented for this build of perl"); |
57
|
|
|
|
|
|
|
#endif |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
3
|
|
|
|
|
|
void flt128_set_prec(pTHX_ int x) { |
61
|
3
|
100
|
|
|
|
|
if(x < 1)croak("1st arg (precision) to flt128_set_prec must be at least 1"); |
62
|
2
|
|
|
|
|
|
_DIGITS = x; |
63
|
2
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
4
|
|
|
|
|
|
int flt128_get_prec(void) { |
66
|
4
|
|
|
|
|
|
return _DIGITS; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
20
|
|
|
|
|
|
int _is_nan(float128 x) { |
70
|
20
|
100
|
|
|
|
|
if(x != x) return 1; |
71
|
11
|
|
|
|
|
|
return 0; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
6
|
|
|
|
|
|
int _is_inf(float128 x) { |
75
|
6
|
50
|
|
|
|
|
if(x != x) return 0; /* NaN */ |
76
|
6
|
50
|
|
|
|
|
if(x == 0.0Q) return 0; /* Zero */ |
77
|
6
|
50
|
|
|
|
|
if(x/x != x/x) { |
78
|
6
|
100
|
|
|
|
|
if(x < 0.0Q) return -1; |
79
|
3
|
|
|
|
|
|
else return 1; |
80
|
|
|
|
|
|
|
} |
81
|
0
|
|
|
|
|
|
return 0; /* Finite Real */ |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
/* Replaced */ |
85
|
|
|
|
|
|
|
/* |
86
|
|
|
|
|
|
|
//int _is_zero(float128 x) { |
87
|
|
|
|
|
|
|
// char * buffer; |
88
|
|
|
|
|
|
|
// |
89
|
|
|
|
|
|
|
// if(x != 0.0Q) return 0; |
90
|
|
|
|
|
|
|
// |
91
|
|
|
|
|
|
|
// Newx(buffer, 2, char); |
92
|
|
|
|
|
|
|
// |
93
|
|
|
|
|
|
|
// quadmath_snprintf(buffer, sizeof buffer, "%.0Qf", x); |
94
|
|
|
|
|
|
|
// |
95
|
|
|
|
|
|
|
// if(!strcmp(buffer, "-0")) { |
96
|
|
|
|
|
|
|
// Safefree(buffer); |
97
|
|
|
|
|
|
|
// return -1; |
98
|
|
|
|
|
|
|
// } |
99
|
|
|
|
|
|
|
// |
100
|
|
|
|
|
|
|
// Safefree(buffer); |
101
|
|
|
|
|
|
|
// return 1; |
102
|
|
|
|
|
|
|
//} |
103
|
|
|
|
|
|
|
*/ |
104
|
|
|
|
|
|
|
|
105
|
16
|
|
|
|
|
|
int _is_zero(float128 x) { |
106
|
|
|
|
|
|
|
|
107
|
16
|
|
|
|
|
|
int n = sizeof(float128); |
108
|
16
|
|
|
|
|
|
void * p = &x; |
109
|
|
|
|
|
|
|
|
110
|
16
|
100
|
|
|
|
|
if(x != 0.0Q) return 0; |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
#ifdef WE_HAVE_BENDIAN /* Big Endian architecture */ |
113
|
|
|
|
|
|
|
if(((unsigned char*)p)[0] >= 128) return -1; |
114
|
|
|
|
|
|
|
#else |
115
|
13
|
100
|
|
|
|
|
if(((unsigned char*)p)[n - 1] >= 128) return -1; |
116
|
|
|
|
|
|
|
#endif |
117
|
7
|
|
|
|
|
|
return 1; |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
43
|
|
|
|
|
|
float128 _get_inf(int sign) { |
121
|
|
|
|
|
|
|
float128 ret; |
122
|
43
|
|
|
|
|
|
ret = FLT128_MAX * 2.0Q; |
123
|
43
|
100
|
|
|
|
|
if(sign < 0) ret *= -1.0Q; |
124
|
43
|
|
|
|
|
|
return ret; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
29
|
|
|
|
|
|
float128 _get_nan(void) { |
128
|
29
|
|
|
|
|
|
float128 inf = _get_inf(1); |
129
|
29
|
|
|
|
|
|
return inf / inf; |
130
|
|
|
|
|
|
|
} |
131
|
|
|
|
|
|
|
|
132
|
14
|
|
|
|
|
|
SV * InfF128(pTHX_ int sign) { |
133
|
|
|
|
|
|
|
float128 * f; |
134
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
135
|
|
|
|
|
|
|
|
136
|
14
|
|
|
|
|
|
Newx(f, 1, float128); |
137
|
14
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in InfF128 function"); |
138
|
|
|
|
|
|
|
|
139
|
14
|
|
|
|
|
|
obj_ref = newSV(0); |
140
|
14
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
141
|
|
|
|
|
|
|
|
142
|
14
|
|
|
|
|
|
*f = _get_inf(sign); |
143
|
|
|
|
|
|
|
|
144
|
14
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
145
|
14
|
|
|
|
|
|
SvREADONLY_on(obj); |
146
|
14
|
|
|
|
|
|
return obj_ref; |
147
|
|
|
|
|
|
|
} |
148
|
|
|
|
|
|
|
|
149
|
29
|
|
|
|
|
|
SV * NaNF128(pTHX) { |
150
|
|
|
|
|
|
|
float128 * f; |
151
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
152
|
|
|
|
|
|
|
|
153
|
29
|
|
|
|
|
|
Newx(f, 1, float128); |
154
|
29
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in NaNF128 function"); |
155
|
|
|
|
|
|
|
|
156
|
29
|
|
|
|
|
|
obj_ref = newSV(0); |
157
|
29
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
158
|
|
|
|
|
|
|
|
159
|
29
|
|
|
|
|
|
*f = _get_nan(); |
160
|
|
|
|
|
|
|
|
161
|
29
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
162
|
29
|
|
|
|
|
|
SvREADONLY_on(obj); |
163
|
29
|
|
|
|
|
|
return obj_ref; |
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
23
|
|
|
|
|
|
SV * ZeroF128(pTHX_ int sign) { |
167
|
|
|
|
|
|
|
float128 * f; |
168
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
169
|
|
|
|
|
|
|
|
170
|
23
|
|
|
|
|
|
Newx(f, 1, float128); |
171
|
23
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in ZeroF128 function"); |
172
|
|
|
|
|
|
|
|
173
|
23
|
|
|
|
|
|
obj_ref = newSV(0); |
174
|
23
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
175
|
|
|
|
|
|
|
|
176
|
23
|
|
|
|
|
|
*f = 0.0Q; |
177
|
23
|
100
|
|
|
|
|
if(sign < 0) *f *= -1; |
178
|
|
|
|
|
|
|
|
179
|
23
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
180
|
23
|
|
|
|
|
|
SvREADONLY_on(obj); |
181
|
23
|
|
|
|
|
|
return obj_ref; |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
|
184
|
39
|
|
|
|
|
|
SV * UnityF128(pTHX_ int sign) { |
185
|
|
|
|
|
|
|
float128 * f; |
186
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
187
|
|
|
|
|
|
|
|
188
|
39
|
|
|
|
|
|
Newx(f, 1, float128); |
189
|
39
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in UnityF128 function"); |
190
|
|
|
|
|
|
|
|
191
|
39
|
|
|
|
|
|
obj_ref = newSV(0); |
192
|
39
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
193
|
|
|
|
|
|
|
|
194
|
39
|
|
|
|
|
|
*f = 1.0Q; |
195
|
39
|
100
|
|
|
|
|
if(sign < 0) *f *= -1; |
196
|
|
|
|
|
|
|
|
197
|
39
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
198
|
39
|
|
|
|
|
|
SvREADONLY_on(obj); |
199
|
39
|
|
|
|
|
|
return obj_ref; |
200
|
|
|
|
|
|
|
} |
201
|
|
|
|
|
|
|
|
202
|
10
|
|
|
|
|
|
SV * is_NaNF128(pTHX_ SV * b) { |
203
|
10
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
204
|
10
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
205
|
10
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) |
206
|
10
|
|
|
|
|
|
return newSViv(_is_nan(*(INT2PTR(float128 *, SvIVX(SvRV(b)))))); |
207
|
|
|
|
|
|
|
} |
208
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::isNaNF128 function"); |
209
|
|
|
|
|
|
|
} |
210
|
|
|
|
|
|
|
|
211
|
6
|
|
|
|
|
|
SV * is_InfF128(pTHX_ SV * b) { |
212
|
6
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
213
|
6
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
214
|
6
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) |
215
|
6
|
|
|
|
|
|
return newSViv(_is_inf(*(INT2PTR(float128 *, SvIVX(SvRV(b)))))); |
216
|
|
|
|
|
|
|
} |
217
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::is_InfF128 function"); |
218
|
|
|
|
|
|
|
} |
219
|
|
|
|
|
|
|
|
220
|
16
|
|
|
|
|
|
SV * is_ZeroF128(pTHX_ SV * b) { |
221
|
16
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
222
|
16
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
223
|
16
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) |
224
|
16
|
|
|
|
|
|
return newSViv(_is_zero(*(INT2PTR(float128 *, SvIVX(SvRV(b)))))); |
225
|
|
|
|
|
|
|
} |
226
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::is_ZeroF128 function"); |
227
|
|
|
|
|
|
|
} |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
|
230
|
288
|
|
|
|
|
|
void _nnum_inc (char * p) { |
231
|
288
|
|
|
|
|
|
int i = 0; |
232
|
1
|
|
|
|
|
|
for(;;i++) { |
233
|
289
|
100
|
|
|
|
|
if(p[i] == 0) break; |
234
|
8
|
100
|
|
|
|
|
if(p[i] != ' ' && p[i] != '\t' && p[i] != '\n' && p[i] != '\r' && p[i] != '\f') { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
235
|
7
|
|
|
|
|
|
nnum++; |
236
|
7
|
|
|
|
|
|
break; |
237
|
|
|
|
|
|
|
} |
238
|
1
|
|
|
|
|
|
} |
239
|
288
|
|
|
|
|
|
} |
240
|
|
|
|
|
|
|
|
241
|
157
|
|
|
|
|
|
SV * STRtoF128(pTHX_ SV * str) { |
242
|
|
|
|
|
|
|
float128 * f; |
243
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
244
|
|
|
|
|
|
|
char * p; |
245
|
157
|
|
|
|
|
|
int inf_or_nan = 0; |
246
|
|
|
|
|
|
|
|
247
|
157
|
|
|
|
|
|
Newx(f, 1, float128); |
248
|
157
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in STRtoF128 function"); |
249
|
|
|
|
|
|
|
|
250
|
157
|
|
|
|
|
|
obj_ref = newSV(0); |
251
|
157
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
254
|
|
|
|
|
|
|
inf_or_nan = _win32_infnanstring(SvPV_nolen(str)); |
255
|
|
|
|
|
|
|
if(inf_or_nan) { |
256
|
|
|
|
|
|
|
if(inf_or_nan == 2) *f = _get_nan(); |
257
|
|
|
|
|
|
|
else *f = _get_inf(inf_or_nan); |
258
|
|
|
|
|
|
|
} |
259
|
|
|
|
|
|
|
else *f = strtoflt128(SvPV_nolen(str), &p); |
260
|
|
|
|
|
|
|
#else |
261
|
157
|
100
|
|
|
|
|
*f = strtoflt128(SvPV_nolen(str), &p); |
262
|
|
|
|
|
|
|
#endif |
263
|
|
|
|
|
|
|
|
264
|
157
|
50
|
|
|
|
|
if(!inf_or_nan) _nnum_inc(p); |
265
|
|
|
|
|
|
|
|
266
|
157
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
267
|
157
|
|
|
|
|
|
SvREADONLY_on(obj); |
268
|
157
|
|
|
|
|
|
return obj_ref; |
269
|
|
|
|
|
|
|
} |
270
|
|
|
|
|
|
|
|
271
|
1
|
|
|
|
|
|
void fromSTR(pTHX_ float128 * f, SV * str) { |
272
|
|
|
|
|
|
|
char * p; |
273
|
1
|
|
|
|
|
|
int inf_or_nan = 0; |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
276
|
|
|
|
|
|
|
inf_or_nan = _win32_infnanstring(SvPV_nolen(str)); |
277
|
|
|
|
|
|
|
if(inf_or_nan) { |
278
|
|
|
|
|
|
|
if(inf_or_nan == 2) *f = _get_nan(); |
279
|
|
|
|
|
|
|
else *f = _get_inf(inf_or_nan); |
280
|
|
|
|
|
|
|
} |
281
|
|
|
|
|
|
|
else *f = strtoflt128(SvPV_nolen(str), &p); |
282
|
|
|
|
|
|
|
#else |
283
|
1
|
50
|
|
|
|
|
*f = strtoflt128(SvPV_nolen(str), &p); |
284
|
|
|
|
|
|
|
#endif |
285
|
|
|
|
|
|
|
|
286
|
1
|
50
|
|
|
|
|
if(!inf_or_nan) _nnum_inc(p); |
287
|
|
|
|
|
|
|
|
288
|
1
|
|
|
|
|
|
} |
289
|
|
|
|
|
|
|
|
290
|
215
|
|
|
|
|
|
SV * NVtoF128(pTHX_ SV * nv) { |
291
|
|
|
|
|
|
|
float128 * f; |
292
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
293
|
|
|
|
|
|
|
|
294
|
215
|
|
|
|
|
|
Newx(f, 1, float128); |
295
|
215
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in NVtoF128 function"); |
296
|
|
|
|
|
|
|
|
297
|
215
|
|
|
|
|
|
obj_ref = newSV(0); |
298
|
215
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
299
|
|
|
|
|
|
|
|
300
|
215
|
100
|
|
|
|
|
*f = (float128)SvNV(nv); |
301
|
|
|
|
|
|
|
|
302
|
215
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
303
|
215
|
|
|
|
|
|
SvREADONLY_on(obj); |
304
|
215
|
|
|
|
|
|
return obj_ref; |
305
|
|
|
|
|
|
|
} |
306
|
|
|
|
|
|
|
|
307
|
1
|
|
|
|
|
|
void fromNV(pTHX_ float128 * f, SV * nv) { |
308
|
1
|
50
|
|
|
|
|
*f = (float128)SvNV(nv); |
309
|
1
|
|
|
|
|
|
} |
310
|
|
|
|
|
|
|
|
311
|
157
|
|
|
|
|
|
SV * IVtoF128(pTHX_ SV * iv) { |
312
|
|
|
|
|
|
|
float128 * f; |
313
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
314
|
|
|
|
|
|
|
|
315
|
157
|
|
|
|
|
|
Newx(f, 1, float128); |
316
|
157
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in IVtoF128 function"); |
317
|
|
|
|
|
|
|
|
318
|
157
|
|
|
|
|
|
obj_ref = newSV(0); |
319
|
157
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
320
|
|
|
|
|
|
|
|
321
|
157
|
50
|
|
|
|
|
*f = (float128)SvIV(iv); |
322
|
|
|
|
|
|
|
|
323
|
157
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
324
|
157
|
|
|
|
|
|
SvREADONLY_on(obj); |
325
|
157
|
|
|
|
|
|
return obj_ref; |
326
|
|
|
|
|
|
|
} |
327
|
|
|
|
|
|
|
|
328
|
1
|
|
|
|
|
|
void fromIV(pTHX_ float128 * f, SV * iv) { |
329
|
1
|
50
|
|
|
|
|
*f = (float128)SvIV(iv); |
330
|
1
|
|
|
|
|
|
} |
331
|
|
|
|
|
|
|
|
332
|
37
|
|
|
|
|
|
SV * UVtoF128(pTHX_ SV * uv) { |
333
|
|
|
|
|
|
|
float128 * f; |
334
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
335
|
|
|
|
|
|
|
|
336
|
37
|
|
|
|
|
|
Newx(f, 1, float128); |
337
|
37
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in UVtoF128 function"); |
338
|
|
|
|
|
|
|
|
339
|
37
|
|
|
|
|
|
obj_ref = newSV(0); |
340
|
37
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
341
|
|
|
|
|
|
|
|
342
|
37
|
100
|
|
|
|
|
*f = (float128)SvUV(uv); |
343
|
|
|
|
|
|
|
|
344
|
37
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
345
|
37
|
|
|
|
|
|
SvREADONLY_on(obj); |
346
|
37
|
|
|
|
|
|
return obj_ref; |
347
|
|
|
|
|
|
|
} |
348
|
|
|
|
|
|
|
|
349
|
1
|
|
|
|
|
|
void fromUV(pTHX_ float128 * f,SV * uv) { |
350
|
1
|
50
|
|
|
|
|
*f = (float128)SvUV(uv); |
351
|
1
|
|
|
|
|
|
} |
352
|
|
|
|
|
|
|
|
353
|
3
|
|
|
|
|
|
void F128toSTR(pTHX_ SV * f) { |
354
|
3
|
|
|
|
|
|
dXSARGS; |
355
|
|
|
|
|
|
|
float128 t; |
356
|
|
|
|
|
|
|
char * buffer; |
357
|
|
|
|
|
|
|
|
358
|
3
|
50
|
|
|
|
|
if(sv_isobject(f)) { |
359
|
3
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(f))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
360
|
3
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
361
|
3
|
50
|
|
|
|
|
EXTEND(SP, 1); |
362
|
3
|
|
|
|
|
|
t = *(INT2PTR(float128 *, SvIVX(SvRV(f)))); |
363
|
|
|
|
|
|
|
|
364
|
3
|
|
|
|
|
|
Newx(buffer, 15 + _DIGITS, char); |
365
|
3
|
50
|
|
|
|
|
if(buffer == NULL) croak("Failed to allocate memory in F128toSTR"); |
366
|
3
|
|
|
|
|
|
quadmath_snprintf(buffer, 15 + _DIGITS, "%.*Qe", _DIGITS - 1, t); |
367
|
3
|
|
|
|
|
|
ST(0) = sv_2mortal(newSVpv(buffer, 0)); |
368
|
3
|
|
|
|
|
|
Safefree(buffer); |
369
|
3
|
|
|
|
|
|
XSRETURN(1); |
370
|
|
|
|
|
|
|
} |
371
|
0
|
|
|
|
|
|
else croak("Invalid object supplied to Math::Float128::F128toSTR function"); |
372
|
|
|
|
|
|
|
} |
373
|
0
|
|
|
|
|
|
else croak("Invalid argument supplied to Math::Float128::F128toSTR function"); |
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
|
376
|
2
|
|
|
|
|
|
void F128toSTRP(pTHX_ SV * f, int decimal_prec) { |
377
|
2
|
|
|
|
|
|
dXSARGS; |
378
|
|
|
|
|
|
|
float128 t; |
379
|
|
|
|
|
|
|
char * buffer; |
380
|
|
|
|
|
|
|
|
381
|
2
|
100
|
|
|
|
|
if(decimal_prec < 1)croak("2nd arg (precision) to F128toSTRP must be at least 1"); |
382
|
|
|
|
|
|
|
|
383
|
1
|
50
|
|
|
|
|
if(sv_isobject(f)) { |
384
|
1
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(f))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
385
|
1
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
386
|
1
|
50
|
|
|
|
|
EXTEND(SP, 1); |
387
|
1
|
|
|
|
|
|
t = *(INT2PTR(float128 *, SvIVX(SvRV(f)))); |
388
|
|
|
|
|
|
|
|
389
|
1
|
|
|
|
|
|
Newx(buffer, 12 + decimal_prec, char); |
390
|
1
|
50
|
|
|
|
|
if(buffer == NULL) croak("Failed to allocate memory in F128toSTRP"); |
391
|
1
|
|
|
|
|
|
quadmath_snprintf(buffer, 12 + decimal_prec, "%.*Qe", decimal_prec - 1, t); |
392
|
1
|
|
|
|
|
|
ST(0) = sv_2mortal(newSVpv(buffer, 0)); |
393
|
1
|
|
|
|
|
|
Safefree(buffer); |
394
|
1
|
|
|
|
|
|
XSRETURN(1); |
395
|
|
|
|
|
|
|
} |
396
|
0
|
|
|
|
|
|
else croak("Invalid object supplied to Math::Float128::F128toSTRP function"); |
397
|
|
|
|
|
|
|
} |
398
|
0
|
|
|
|
|
|
else croak("Invalid argument supplied to Math::Float128::F128toSTRP function"); |
399
|
|
|
|
|
|
|
} |
400
|
|
|
|
|
|
|
|
401
|
1083
|
|
|
|
|
|
void DESTROY(pTHX_ SV * f) { |
402
|
1083
|
|
|
|
|
|
Safefree(INT2PTR(float128 *, SvIVX(SvRV(f)))); |
403
|
1083
|
|
|
|
|
|
} |
404
|
|
|
|
|
|
|
|
405
|
0
|
|
|
|
|
|
SV * _LDBL_DIG(pTHX) { |
406
|
|
|
|
|
|
|
#ifdef LDBL_DIG |
407
|
0
|
|
|
|
|
|
return newSViv(LDBL_DIG); |
408
|
|
|
|
|
|
|
#else |
409
|
|
|
|
|
|
|
croak("LDBL_DIG not implemented"); |
410
|
|
|
|
|
|
|
#endif |
411
|
|
|
|
|
|
|
} |
412
|
|
|
|
|
|
|
|
413
|
0
|
|
|
|
|
|
SV * _DBL_DIG(pTHX) { |
414
|
|
|
|
|
|
|
#ifdef DBL_DIG |
415
|
0
|
|
|
|
|
|
return newSViv(DBL_DIG); |
416
|
|
|
|
|
|
|
#else |
417
|
|
|
|
|
|
|
croak("DBL_DIG not implemented"); |
418
|
|
|
|
|
|
|
#endif |
419
|
|
|
|
|
|
|
} |
420
|
|
|
|
|
|
|
|
421
|
2
|
|
|
|
|
|
SV * _FLT128_DIG(pTHX) { |
422
|
|
|
|
|
|
|
#ifdef FLT128_DIG |
423
|
2
|
|
|
|
|
|
return newSViv(FLT128_DIG); |
424
|
|
|
|
|
|
|
#else |
425
|
|
|
|
|
|
|
croak("FLT128_DIG not implemented"); |
426
|
|
|
|
|
|
|
#endif |
427
|
|
|
|
|
|
|
} |
428
|
|
|
|
|
|
|
|
429
|
81
|
|
|
|
|
|
SV * _overload_add(pTHX_ SV * a, SV * b, SV * third) { |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
float128 * ld; |
432
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
433
|
|
|
|
|
|
|
|
434
|
81
|
|
|
|
|
|
Newx(ld, 1, float128); |
435
|
81
|
50
|
|
|
|
|
if(ld == NULL) croak("Failed to allocate memory in _overload_add function"); |
436
|
|
|
|
|
|
|
|
437
|
81
|
|
|
|
|
|
obj_ref = newSV(0); |
438
|
81
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
439
|
|
|
|
|
|
|
|
440
|
81
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,ld)); |
441
|
81
|
|
|
|
|
|
SvREADONLY_on(obj); |
442
|
|
|
|
|
|
|
|
443
|
81
|
100
|
|
|
|
|
if(SvUOK(b)) { |
444
|
1
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) + (float128)SvUVX(b); |
445
|
1
|
|
|
|
|
|
return obj_ref; |
446
|
|
|
|
|
|
|
} |
447
|
|
|
|
|
|
|
|
448
|
80
|
100
|
|
|
|
|
if(SvIOK(b)) { |
449
|
5
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) + (float128)SvIVX(b); |
450
|
5
|
|
|
|
|
|
return obj_ref; |
451
|
|
|
|
|
|
|
} |
452
|
|
|
|
|
|
|
|
453
|
75
|
100
|
|
|
|
|
if(SvPOK(b)) { |
454
|
|
|
|
|
|
|
char * p; |
455
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
456
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
457
|
|
|
|
|
|
|
#endif |
458
|
|
|
|
|
|
|
|
459
|
5
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_add");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
462
|
|
|
|
|
|
|
if(inf_or_nan) { |
463
|
|
|
|
|
|
|
if(inf_or_nan == 2) *ld = _get_nan(); |
464
|
|
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) + _get_inf(inf_or_nan); |
465
|
|
|
|
|
|
|
} |
466
|
|
|
|
|
|
|
else { |
467
|
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) + strtoflt128(SvPV_nolen(b), &p); |
468
|
|
|
|
|
|
|
_nnum_inc(p); |
469
|
|
|
|
|
|
|
} |
470
|
|
|
|
|
|
|
#else |
471
|
5
|
50
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) + strtoflt128(SvPV_nolen(b), &p); |
472
|
5
|
|
|
|
|
|
_nnum_inc(p); |
473
|
|
|
|
|
|
|
#endif |
474
|
5
|
|
|
|
|
|
return obj_ref; |
475
|
|
|
|
|
|
|
} |
476
|
|
|
|
|
|
|
|
477
|
70
|
100
|
|
|
|
|
if(SvNOK(b)) { |
478
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
479
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
480
|
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) + _get_inf(SvNVX(b) > 0 ? 1 : -1); |
481
|
|
|
|
|
|
|
return obj_ref; |
482
|
|
|
|
|
|
|
} |
483
|
|
|
|
|
|
|
#endif |
484
|
39
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) + (float128)SvNVX(b); |
485
|
39
|
|
|
|
|
|
return obj_ref; |
486
|
|
|
|
|
|
|
} |
487
|
|
|
|
|
|
|
|
488
|
31
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
489
|
31
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
490
|
31
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
491
|
31
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) + *(INT2PTR(float128 *, SvIVX(SvRV(b)))); |
492
|
31
|
|
|
|
|
|
return obj_ref; |
493
|
|
|
|
|
|
|
} |
494
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_add function"); |
495
|
|
|
|
|
|
|
} |
496
|
|
|
|
|
|
|
|
497
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_add function"); |
498
|
|
|
|
|
|
|
} |
499
|
|
|
|
|
|
|
|
500
|
16
|
|
|
|
|
|
SV * _overload_mul(pTHX_ SV * a, SV * b, SV * third) { |
501
|
|
|
|
|
|
|
|
502
|
|
|
|
|
|
|
float128 * ld; |
503
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
504
|
|
|
|
|
|
|
|
505
|
16
|
|
|
|
|
|
Newx(ld, 1, float128); |
506
|
16
|
50
|
|
|
|
|
if(ld == NULL) croak("Failed to allocate memory in _overload_mul function"); |
507
|
|
|
|
|
|
|
|
508
|
16
|
|
|
|
|
|
obj_ref = newSV(0); |
509
|
16
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
510
|
|
|
|
|
|
|
|
511
|
16
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,ld)); |
512
|
16
|
|
|
|
|
|
SvREADONLY_on(obj); |
513
|
|
|
|
|
|
|
|
514
|
16
|
100
|
|
|
|
|
if(SvUOK(b)) { |
515
|
1
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) * (float128)SvUVX(b); |
516
|
1
|
|
|
|
|
|
return obj_ref; |
517
|
|
|
|
|
|
|
} |
518
|
|
|
|
|
|
|
|
519
|
15
|
100
|
|
|
|
|
if(SvIOK(b)) { |
520
|
3
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) * (float128)SvIVX(b); |
521
|
3
|
|
|
|
|
|
return obj_ref; |
522
|
|
|
|
|
|
|
} |
523
|
|
|
|
|
|
|
|
524
|
12
|
100
|
|
|
|
|
if(SvPOK(b)) { |
525
|
|
|
|
|
|
|
char * p; |
526
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
527
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
528
|
|
|
|
|
|
|
#endif |
529
|
|
|
|
|
|
|
|
530
|
5
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_mul");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
531
|
|
|
|
|
|
|
|
532
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
533
|
|
|
|
|
|
|
if(inf_or_nan) { |
534
|
|
|
|
|
|
|
if(inf_or_nan == 2) *ld = _get_nan(); |
535
|
|
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) * _get_inf(inf_or_nan); |
536
|
|
|
|
|
|
|
} |
537
|
|
|
|
|
|
|
else { |
538
|
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) * strtoflt128(SvPV_nolen(b), &p); |
539
|
|
|
|
|
|
|
_nnum_inc(p); |
540
|
|
|
|
|
|
|
} |
541
|
|
|
|
|
|
|
#else |
542
|
5
|
50
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) * strtoflt128(SvPV_nolen(b), &p); |
543
|
5
|
|
|
|
|
|
_nnum_inc(p); |
544
|
|
|
|
|
|
|
#endif |
545
|
5
|
|
|
|
|
|
return obj_ref; |
546
|
|
|
|
|
|
|
} |
547
|
|
|
|
|
|
|
|
548
|
7
|
100
|
|
|
|
|
if(SvNOK(b)) { |
549
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
550
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
551
|
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) * _get_inf(SvNVX(b) > 0 ? 1 : -1); |
552
|
|
|
|
|
|
|
return obj_ref; |
553
|
|
|
|
|
|
|
} |
554
|
|
|
|
|
|
|
#endif |
555
|
4
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) * (float128)SvNVX(b); |
556
|
4
|
|
|
|
|
|
return obj_ref; |
557
|
|
|
|
|
|
|
} |
558
|
|
|
|
|
|
|
|
559
|
3
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
560
|
3
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
561
|
3
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
562
|
3
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) * *(INT2PTR(float128 *, SvIVX(SvRV(b)))); |
563
|
3
|
|
|
|
|
|
return obj_ref; |
564
|
|
|
|
|
|
|
} |
565
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_mul function"); |
566
|
|
|
|
|
|
|
} |
567
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_mul function"); |
568
|
|
|
|
|
|
|
} |
569
|
|
|
|
|
|
|
|
570
|
145
|
|
|
|
|
|
SV * _overload_sub(pTHX_ SV * a, SV * b, SV * third) { |
571
|
|
|
|
|
|
|
float128 * ld; |
572
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
573
|
|
|
|
|
|
|
|
574
|
145
|
|
|
|
|
|
Newx(ld, 1, float128); |
575
|
145
|
50
|
|
|
|
|
if(ld == NULL) croak("Failed to allocate memory in _overload_sub function"); |
576
|
|
|
|
|
|
|
|
577
|
145
|
|
|
|
|
|
obj_ref = newSV(0); |
578
|
145
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
579
|
|
|
|
|
|
|
|
580
|
145
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,ld)); |
581
|
145
|
|
|
|
|
|
SvREADONLY_on(obj); |
582
|
|
|
|
|
|
|
|
583
|
145
|
100
|
|
|
|
|
if(SvUOK(b)) { |
584
|
2
|
50
|
|
|
|
|
if(SWITCH_ARGS) *ld = (float128)SvUVX(b) - *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
585
|
1
|
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) - (float128)SvUVX(b); |
586
|
2
|
|
|
|
|
|
return obj_ref; |
587
|
|
|
|
|
|
|
} |
588
|
|
|
|
|
|
|
|
589
|
143
|
100
|
|
|
|
|
if(SvIOK(b)) { |
590
|
23
|
50
|
|
|
|
|
if(SWITCH_ARGS) *ld = (float128)SvIVX(b) - *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
591
|
10
|
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) - (float128)SvIVX(b); |
592
|
23
|
|
|
|
|
|
return obj_ref; |
593
|
|
|
|
|
|
|
} |
594
|
|
|
|
|
|
|
|
595
|
120
|
100
|
|
|
|
|
if(SvPOK(b)) { |
596
|
|
|
|
|
|
|
char * p; |
597
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
598
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
599
|
|
|
|
|
|
|
#endif |
600
|
|
|
|
|
|
|
|
601
|
9
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_sub");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
602
|
|
|
|
|
|
|
|
603
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
604
|
|
|
|
|
|
|
if(inf_or_nan) { |
605
|
|
|
|
|
|
|
if(inf_or_nan == 2) *ld = _get_nan(); |
606
|
|
|
|
|
|
|
else { |
607
|
|
|
|
|
|
|
if(SWITCH_ARGS) *ld = _get_inf(inf_or_nan) - *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
608
|
|
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) - _get_inf(inf_or_nan); |
609
|
|
|
|
|
|
|
} |
610
|
|
|
|
|
|
|
} |
611
|
|
|
|
|
|
|
else { |
612
|
|
|
|
|
|
|
if(SWITCH_ARGS) *ld = strtoflt128(SvPV_nolen(b), &p) - *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
613
|
|
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) - strtoflt128(SvPV_nolen(b), &p); |
614
|
|
|
|
|
|
|
_nnum_inc(p); |
615
|
|
|
|
|
|
|
} |
616
|
|
|
|
|
|
|
#else |
617
|
9
|
50
|
|
|
|
|
if(SWITCH_ARGS) *ld = strtoflt128(SvPV_nolen(b), &p) - *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
618
|
8
|
50
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) - strtoflt128(SvPV_nolen(b), &p); |
619
|
9
|
|
|
|
|
|
_nnum_inc(p); |
620
|
|
|
|
|
|
|
#endif |
621
|
9
|
|
|
|
|
|
return obj_ref; |
622
|
|
|
|
|
|
|
} |
623
|
|
|
|
|
|
|
|
624
|
111
|
100
|
|
|
|
|
if(SvNOK(b)) { |
625
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
626
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
627
|
|
|
|
|
|
|
if(SWITCH_ARGS) *ld = _get_inf(SvNVX(b) > 0 ? 1 : -1) - *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
628
|
|
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) - _get_inf(SvNVX(b) > 0 ? 1 : -1); |
629
|
|
|
|
|
|
|
return obj_ref; |
630
|
|
|
|
|
|
|
} |
631
|
|
|
|
|
|
|
#endif |
632
|
32
|
50
|
|
|
|
|
if(SWITCH_ARGS) *ld = (float128)SvNVX(b) - *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
633
|
31
|
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) - (float128)SvNVX(b); |
634
|
32
|
|
|
|
|
|
return obj_ref; |
635
|
|
|
|
|
|
|
} |
636
|
|
|
|
|
|
|
|
637
|
79
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
638
|
79
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
639
|
79
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
640
|
79
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) - *(INT2PTR(float128 *, SvIVX(SvRV(b)))); |
641
|
79
|
|
|
|
|
|
return obj_ref; |
642
|
|
|
|
|
|
|
} |
643
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_sub function"); |
644
|
|
|
|
|
|
|
} |
645
|
|
|
|
|
|
|
|
646
|
|
|
|
|
|
|
/* |
647
|
|
|
|
|
|
|
else { |
648
|
|
|
|
|
|
|
if(SWITCH_ARGS) { |
649
|
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) * -1.0L; |
650
|
|
|
|
|
|
|
return obj_ref; |
651
|
|
|
|
|
|
|
} |
652
|
|
|
|
|
|
|
} |
653
|
|
|
|
|
|
|
*/ |
654
|
|
|
|
|
|
|
|
655
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_sub function"); |
656
|
|
|
|
|
|
|
|
657
|
|
|
|
|
|
|
} |
658
|
|
|
|
|
|
|
|
659
|
21
|
|
|
|
|
|
SV * _overload_div(pTHX_ SV * a, SV * b, SV * third) { |
660
|
|
|
|
|
|
|
float128 * ld; |
661
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
662
|
|
|
|
|
|
|
|
663
|
21
|
|
|
|
|
|
Newx(ld, 1, float128); |
664
|
21
|
50
|
|
|
|
|
if(ld == NULL) croak("Failed to allocate memory in _overload_div function"); |
665
|
|
|
|
|
|
|
|
666
|
21
|
|
|
|
|
|
obj_ref = newSV(0); |
667
|
21
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
668
|
|
|
|
|
|
|
|
669
|
21
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,ld)); |
670
|
21
|
|
|
|
|
|
SvREADONLY_on(obj); |
671
|
|
|
|
|
|
|
|
672
|
21
|
100
|
|
|
|
|
if(SvUOK(b)) { |
673
|
2
|
50
|
|
|
|
|
if(SWITCH_ARGS) *ld = (float128)SvUVX(b) / *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
674
|
1
|
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) / (float128)SvUVX(b); |
675
|
2
|
|
|
|
|
|
return obj_ref; |
676
|
|
|
|
|
|
|
} |
677
|
|
|
|
|
|
|
|
678
|
19
|
100
|
|
|
|
|
if(SvIOK(b)) { |
679
|
4
|
50
|
|
|
|
|
if(SWITCH_ARGS) *ld = (float128)SvIVX(b) / *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
680
|
2
|
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) / (float128)SvIVX(b); |
681
|
4
|
|
|
|
|
|
return obj_ref; |
682
|
|
|
|
|
|
|
} |
683
|
|
|
|
|
|
|
|
684
|
15
|
100
|
|
|
|
|
if(SvPOK(b)) { |
685
|
|
|
|
|
|
|
char * p; |
686
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
687
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
688
|
|
|
|
|
|
|
#endif |
689
|
|
|
|
|
|
|
|
690
|
6
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_div");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
691
|
|
|
|
|
|
|
|
692
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
693
|
|
|
|
|
|
|
if(inf_or_nan) { |
694
|
|
|
|
|
|
|
if(inf_or_nan == 2) *ld = _get_nan(); |
695
|
|
|
|
|
|
|
else { |
696
|
|
|
|
|
|
|
if(SWITCH_ARGS) *ld = _get_inf(inf_or_nan) / *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
697
|
|
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) / _get_inf(inf_or_nan); |
698
|
|
|
|
|
|
|
} |
699
|
|
|
|
|
|
|
} |
700
|
|
|
|
|
|
|
else { |
701
|
|
|
|
|
|
|
if(SWITCH_ARGS) *ld = strtoflt128(SvPV_nolen(b), &p) / *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
702
|
|
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) / strtoflt128(SvPV_nolen(b), &p); |
703
|
|
|
|
|
|
|
_nnum_inc(p); |
704
|
|
|
|
|
|
|
} |
705
|
|
|
|
|
|
|
#else |
706
|
6
|
50
|
|
|
|
|
if(SWITCH_ARGS) *ld = strtoflt128(SvPV_nolen(b), &p) / *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
707
|
5
|
50
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) / strtoflt128(SvPV_nolen(b), &p); |
708
|
6
|
|
|
|
|
|
_nnum_inc(p); |
709
|
|
|
|
|
|
|
#endif |
710
|
6
|
|
|
|
|
|
return obj_ref; |
711
|
|
|
|
|
|
|
} |
712
|
|
|
|
|
|
|
|
713
|
9
|
100
|
|
|
|
|
if(SvNOK(b)) { |
714
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
715
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
716
|
|
|
|
|
|
|
if(SWITCH_ARGS) *ld = _get_inf(SvNVX(b) > 0 ? 1 : -1) / *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
717
|
|
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) / _get_inf(SvNVX(b) > 0 ? 1 : -1); |
718
|
|
|
|
|
|
|
return obj_ref; |
719
|
|
|
|
|
|
|
} |
720
|
|
|
|
|
|
|
#endif |
721
|
6
|
50
|
|
|
|
|
if(SWITCH_ARGS) *ld = (float128)SvNVX(b) / *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
722
|
5
|
|
|
|
|
|
else *ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) / (float128)SvNVX(b); |
723
|
6
|
|
|
|
|
|
return obj_ref; |
724
|
|
|
|
|
|
|
} |
725
|
|
|
|
|
|
|
|
726
|
3
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
727
|
3
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
728
|
3
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
729
|
3
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))) / *(INT2PTR(float128 *, SvIVX(SvRV(b)))); |
730
|
3
|
|
|
|
|
|
return obj_ref; |
731
|
|
|
|
|
|
|
} |
732
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_div function"); |
733
|
|
|
|
|
|
|
} |
734
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_div function"); |
735
|
|
|
|
|
|
|
} |
736
|
|
|
|
|
|
|
|
737
|
200
|
|
|
|
|
|
SV * _overload_equiv(pTHX_ SV * a, SV * b, SV * third) { |
738
|
|
|
|
|
|
|
|
739
|
200
|
100
|
|
|
|
|
if(SvUOK(b)) { |
740
|
10
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == (float128)SvUVX(b)) return newSViv(1); |
741
|
0
|
|
|
|
|
|
return newSViv(0); |
742
|
|
|
|
|
|
|
} |
743
|
|
|
|
|
|
|
|
744
|
190
|
100
|
|
|
|
|
if(SvIOK(b)) { |
745
|
51
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == (float128)SvIVX(b)) return newSViv(1); |
746
|
0
|
|
|
|
|
|
return newSViv(0); |
747
|
|
|
|
|
|
|
} |
748
|
|
|
|
|
|
|
|
749
|
139
|
100
|
|
|
|
|
if(SvPOK(b)) { |
750
|
|
|
|
|
|
|
char * p; |
751
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
752
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
753
|
|
|
|
|
|
|
#endif |
754
|
|
|
|
|
|
|
|
755
|
19
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_equiv");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
756
|
|
|
|
|
|
|
|
757
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
758
|
|
|
|
|
|
|
if(inf_or_nan) { |
759
|
|
|
|
|
|
|
if(inf_or_nan == 2) return newSViv(0); |
760
|
|
|
|
|
|
|
else { |
761
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == _get_inf(inf_or_nan)) return newSViv(1); |
762
|
|
|
|
|
|
|
return newSViv(0); |
763
|
|
|
|
|
|
|
} |
764
|
|
|
|
|
|
|
} |
765
|
|
|
|
|
|
|
else { |
766
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == strtoflt128(SvPV_nolen(b), &p)) { |
767
|
|
|
|
|
|
|
_nnum_inc(p); |
768
|
|
|
|
|
|
|
return newSViv(1); |
769
|
|
|
|
|
|
|
} |
770
|
|
|
|
|
|
|
_nnum_inc(p); |
771
|
|
|
|
|
|
|
return newSViv(0); |
772
|
|
|
|
|
|
|
} |
773
|
|
|
|
|
|
|
#else |
774
|
19
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == strtoflt128(SvPV_nolen(b), &p)) { |
|
|
100
|
|
|
|
|
|
775
|
15
|
|
|
|
|
|
_nnum_inc(p); |
776
|
15
|
|
|
|
|
|
return newSViv(1); |
777
|
|
|
|
|
|
|
} |
778
|
4
|
|
|
|
|
|
_nnum_inc(p); |
779
|
19
|
|
|
|
|
|
return newSViv(0); |
780
|
|
|
|
|
|
|
#endif |
781
|
|
|
|
|
|
|
} |
782
|
|
|
|
|
|
|
|
783
|
120
|
100
|
|
|
|
|
if(SvNOK(b)) { |
784
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
785
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
786
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == _get_inf(SvNVX(b) > 0 ? 1 : -1)) |
787
|
|
|
|
|
|
|
return newSViv(1); |
788
|
|
|
|
|
|
|
return newSViv(0); |
789
|
|
|
|
|
|
|
} |
790
|
|
|
|
|
|
|
#endif |
791
|
21
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == (float128)SvNVX(b)) return newSViv(1); |
792
|
6
|
|
|
|
|
|
return newSViv(0); |
793
|
|
|
|
|
|
|
} |
794
|
|
|
|
|
|
|
|
795
|
99
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
796
|
99
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
797
|
99
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
798
|
99
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == *(INT2PTR(float128 *, SvIVX(SvRV(b))))) return newSViv(1); |
799
|
0
|
|
|
|
|
|
return newSViv(0); |
800
|
|
|
|
|
|
|
} |
801
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_equiv function"); |
802
|
|
|
|
|
|
|
} |
803
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_equiv function"); |
804
|
|
|
|
|
|
|
} |
805
|
|
|
|
|
|
|
|
806
|
26
|
|
|
|
|
|
SV * _overload_not_equiv(pTHX_ SV * a, SV * b, SV * third) { |
807
|
|
|
|
|
|
|
|
808
|
26
|
100
|
|
|
|
|
if(SvUOK(b)) { |
809
|
2
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) != (float128)SvUVX(b)) return newSViv(1); |
810
|
0
|
|
|
|
|
|
return newSViv(0); |
811
|
|
|
|
|
|
|
} |
812
|
|
|
|
|
|
|
|
813
|
24
|
100
|
|
|
|
|
if(SvIOK(b)) { |
814
|
2
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) != (float128)SvIVX(b)) return newSViv(1); |
815
|
0
|
|
|
|
|
|
return newSViv(0); |
816
|
|
|
|
|
|
|
} |
817
|
|
|
|
|
|
|
|
818
|
22
|
100
|
|
|
|
|
if(SvPOK(b)) { |
819
|
|
|
|
|
|
|
char * p; |
820
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
821
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
822
|
|
|
|
|
|
|
#endif |
823
|
|
|
|
|
|
|
|
824
|
7
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_not_equiv");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
825
|
|
|
|
|
|
|
|
826
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
827
|
|
|
|
|
|
|
if(inf_or_nan) { |
828
|
|
|
|
|
|
|
if(inf_or_nan == 2) return newSViv(1); |
829
|
|
|
|
|
|
|
else { |
830
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) != _get_inf(inf_or_nan)) return newSViv(1); |
831
|
|
|
|
|
|
|
return newSViv(0); |
832
|
|
|
|
|
|
|
} |
833
|
|
|
|
|
|
|
} |
834
|
|
|
|
|
|
|
else { |
835
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) != strtoflt128(SvPV_nolen(b), &p)) { |
836
|
|
|
|
|
|
|
_nnum_inc(p); |
837
|
|
|
|
|
|
|
return newSViv(1); |
838
|
|
|
|
|
|
|
} |
839
|
|
|
|
|
|
|
_nnum_inc(p); |
840
|
|
|
|
|
|
|
return newSViv(0); |
841
|
|
|
|
|
|
|
} |
842
|
|
|
|
|
|
|
#else |
843
|
|
|
|
|
|
|
|
844
|
7
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) != strtoflt128(SvPV_nolen(b), &p)) { |
|
|
100
|
|
|
|
|
|
845
|
6
|
|
|
|
|
|
_nnum_inc(p); |
846
|
6
|
|
|
|
|
|
return newSViv(1); |
847
|
|
|
|
|
|
|
} |
848
|
1
|
|
|
|
|
|
_nnum_inc(p); |
849
|
7
|
|
|
|
|
|
return newSViv(0); |
850
|
|
|
|
|
|
|
#endif |
851
|
|
|
|
|
|
|
} |
852
|
|
|
|
|
|
|
|
853
|
15
|
100
|
|
|
|
|
if(SvNOK(b)) { |
854
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
855
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
856
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) != _get_inf(SvNVX(b) > 0 ? 1 : -1)) |
857
|
|
|
|
|
|
|
return newSViv(1); |
858
|
|
|
|
|
|
|
return newSViv(0); |
859
|
|
|
|
|
|
|
} |
860
|
|
|
|
|
|
|
#endif |
861
|
9
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) != (float128)SvNVX(b)) return newSViv(1); |
862
|
0
|
|
|
|
|
|
return newSViv(0); |
863
|
|
|
|
|
|
|
} |
864
|
|
|
|
|
|
|
|
865
|
6
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
866
|
6
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
867
|
6
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
868
|
6
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == *(INT2PTR(float128 *, SvIVX(SvRV(b))))) return newSViv(0); |
869
|
6
|
|
|
|
|
|
return newSViv(1); |
870
|
|
|
|
|
|
|
} |
871
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_not_equiv function"); |
872
|
|
|
|
|
|
|
} |
873
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_not_equiv function"); |
874
|
|
|
|
|
|
|
} |
875
|
|
|
|
|
|
|
|
876
|
4
|
|
|
|
|
|
SV * _overload_true(pTHX_ SV * a, SV * b, SV * third) { |
877
|
|
|
|
|
|
|
|
878
|
4
|
100
|
|
|
|
|
if(_is_nan(*(INT2PTR(float128 *, SvIVX(SvRV(a)))))) return newSViv(0); |
879
|
3
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) != 0.0Q) return newSViv(1); |
880
|
1
|
|
|
|
|
|
return newSViv(0); |
881
|
|
|
|
|
|
|
} |
882
|
|
|
|
|
|
|
|
883
|
6
|
|
|
|
|
|
SV * _overload_not(pTHX_ SV * a, SV * b, SV * third) { |
884
|
6
|
100
|
|
|
|
|
if(_is_nan(*(INT2PTR(float128 *, SvIVX(SvRV(a)))))) return newSViv(1); |
885
|
5
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) != 0.0L) return newSViv(0); |
886
|
3
|
|
|
|
|
|
return newSViv(1); |
887
|
|
|
|
|
|
|
} |
888
|
|
|
|
|
|
|
|
889
|
16
|
|
|
|
|
|
SV * _overload_add_eq(pTHX_ SV * a, SV * b, SV * third) { |
890
|
|
|
|
|
|
|
|
891
|
16
|
|
|
|
|
|
SvREFCNT_inc(a); |
892
|
|
|
|
|
|
|
|
893
|
16
|
100
|
|
|
|
|
if(SvUOK(b)) { |
894
|
1
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) += (float128)SvUVX(b); |
895
|
1
|
|
|
|
|
|
return a; |
896
|
|
|
|
|
|
|
} |
897
|
|
|
|
|
|
|
|
898
|
15
|
100
|
|
|
|
|
if(SvIOK(b)) { |
899
|
1
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) += (float128)SvIVX(b); |
900
|
1
|
|
|
|
|
|
return a; |
901
|
|
|
|
|
|
|
} |
902
|
|
|
|
|
|
|
|
903
|
14
|
100
|
|
|
|
|
if(SvPOK(b)) { |
904
|
|
|
|
|
|
|
char * p; |
905
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
906
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
907
|
|
|
|
|
|
|
#endif |
908
|
|
|
|
|
|
|
|
909
|
5
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_add_eq");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
910
|
|
|
|
|
|
|
|
911
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
912
|
|
|
|
|
|
|
|
913
|
|
|
|
|
|
|
if(inf_or_nan) { |
914
|
|
|
|
|
|
|
if(inf_or_nan == 2) { |
915
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) = _get_nan(); |
916
|
|
|
|
|
|
|
return a; |
917
|
|
|
|
|
|
|
} |
918
|
|
|
|
|
|
|
|
919
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) += _get_inf(inf_or_nan); |
920
|
|
|
|
|
|
|
return a; |
921
|
|
|
|
|
|
|
} |
922
|
|
|
|
|
|
|
|
923
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) += strtoflt128(SvPV_nolen(b), &p); |
924
|
|
|
|
|
|
|
_nnum_inc(p); |
925
|
|
|
|
|
|
|
return a; |
926
|
|
|
|
|
|
|
#else |
927
|
|
|
|
|
|
|
|
928
|
5
|
50
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) += strtoflt128(SvPV_nolen(b), &p); |
929
|
5
|
|
|
|
|
|
_nnum_inc(p); |
930
|
5
|
|
|
|
|
|
return a; |
931
|
|
|
|
|
|
|
#endif |
932
|
|
|
|
|
|
|
} |
933
|
|
|
|
|
|
|
|
934
|
9
|
100
|
|
|
|
|
if(SvNOK(b)) { |
935
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
936
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
937
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) += _get_inf(SvNVX(b) > 0 ? 1 : -1); |
938
|
|
|
|
|
|
|
return a; |
939
|
|
|
|
|
|
|
} |
940
|
|
|
|
|
|
|
#endif |
941
|
4
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) += (float128)SvNVX(b); |
942
|
4
|
|
|
|
|
|
return a; |
943
|
|
|
|
|
|
|
} |
944
|
|
|
|
|
|
|
|
945
|
5
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
946
|
5
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
947
|
5
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
948
|
5
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) += *(INT2PTR(float128 *, SvIVX(SvRV(b)))); |
949
|
5
|
|
|
|
|
|
return a; |
950
|
|
|
|
|
|
|
} |
951
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
952
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_add_eq function"); |
953
|
|
|
|
|
|
|
} |
954
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
955
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_add_eq function"); |
956
|
|
|
|
|
|
|
} |
957
|
|
|
|
|
|
|
|
958
|
15
|
|
|
|
|
|
SV * _overload_mul_eq(pTHX_ SV * a, SV * b, SV * third) { |
959
|
|
|
|
|
|
|
|
960
|
15
|
|
|
|
|
|
SvREFCNT_inc(a); |
961
|
|
|
|
|
|
|
|
962
|
15
|
100
|
|
|
|
|
if(SvUOK(b)) { |
963
|
1
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) *= (float128)SvUVX(b); |
964
|
1
|
|
|
|
|
|
return a; |
965
|
|
|
|
|
|
|
} |
966
|
|
|
|
|
|
|
|
967
|
14
|
100
|
|
|
|
|
if(SvIOK(b)) { |
968
|
1
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) *= (float128)SvIVX(b); |
969
|
1
|
|
|
|
|
|
return a; |
970
|
|
|
|
|
|
|
} |
971
|
|
|
|
|
|
|
|
972
|
13
|
100
|
|
|
|
|
if(SvPOK(b)) { |
973
|
|
|
|
|
|
|
char * p; |
974
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
975
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
976
|
|
|
|
|
|
|
#endif |
977
|
|
|
|
|
|
|
|
978
|
6
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_mul_eq");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
979
|
|
|
|
|
|
|
|
980
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
981
|
|
|
|
|
|
|
|
982
|
|
|
|
|
|
|
if(inf_or_nan) { |
983
|
|
|
|
|
|
|
if(inf_or_nan == 2) { |
984
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) = _get_nan(); |
985
|
|
|
|
|
|
|
return a; |
986
|
|
|
|
|
|
|
} |
987
|
|
|
|
|
|
|
|
988
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) *= _get_inf(inf_or_nan); |
989
|
|
|
|
|
|
|
return a; |
990
|
|
|
|
|
|
|
} |
991
|
|
|
|
|
|
|
|
992
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) *= strtoflt128(SvPV_nolen(b), &p); |
993
|
|
|
|
|
|
|
_nnum_inc(p); |
994
|
|
|
|
|
|
|
return a; |
995
|
|
|
|
|
|
|
#else |
996
|
|
|
|
|
|
|
|
997
|
6
|
50
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) *= strtoflt128(SvPV_nolen(b), &p); |
998
|
6
|
|
|
|
|
|
_nnum_inc(p); |
999
|
6
|
|
|
|
|
|
return a; |
1000
|
|
|
|
|
|
|
#endif |
1001
|
|
|
|
|
|
|
} |
1002
|
|
|
|
|
|
|
|
1003
|
7
|
100
|
|
|
|
|
if(SvNOK(b)) { |
1004
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
1005
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
1006
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) *= _get_inf(SvNVX(b) > 0 ? 1 : -1); |
1007
|
|
|
|
|
|
|
return a; |
1008
|
|
|
|
|
|
|
} |
1009
|
|
|
|
|
|
|
#endif |
1010
|
4
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) *= (float128)SvNVX(b); |
1011
|
4
|
|
|
|
|
|
return a; |
1012
|
|
|
|
|
|
|
} |
1013
|
|
|
|
|
|
|
|
1014
|
3
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
1015
|
3
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1016
|
3
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
1017
|
3
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) *= *(INT2PTR(float128 *, SvIVX(SvRV(b)))); |
1018
|
3
|
|
|
|
|
|
return a; |
1019
|
|
|
|
|
|
|
} |
1020
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
1021
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_mul_eq function"); |
1022
|
|
|
|
|
|
|
} |
1023
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
1024
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_mul_eq function"); |
1025
|
|
|
|
|
|
|
} |
1026
|
|
|
|
|
|
|
|
1027
|
13
|
|
|
|
|
|
SV * _overload_sub_eq(pTHX_ SV * a, SV * b, SV * third) { |
1028
|
|
|
|
|
|
|
|
1029
|
13
|
|
|
|
|
|
SvREFCNT_inc(a); |
1030
|
|
|
|
|
|
|
|
1031
|
13
|
100
|
|
|
|
|
if(SvUOK(b)) { |
1032
|
1
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) -= (float128)SvUVX(b); |
1033
|
1
|
|
|
|
|
|
return a; |
1034
|
|
|
|
|
|
|
} |
1035
|
|
|
|
|
|
|
|
1036
|
12
|
100
|
|
|
|
|
if(SvIOK(b)) { |
1037
|
1
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) -= (float128)SvIVX(b); |
1038
|
1
|
|
|
|
|
|
return a; |
1039
|
|
|
|
|
|
|
} |
1040
|
|
|
|
|
|
|
|
1041
|
11
|
100
|
|
|
|
|
if(SvPOK(b)) { |
1042
|
|
|
|
|
|
|
char * p; |
1043
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1044
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
1045
|
|
|
|
|
|
|
#endif |
1046
|
|
|
|
|
|
|
|
1047
|
5
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_sub_eq");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1048
|
|
|
|
|
|
|
|
1049
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1050
|
|
|
|
|
|
|
|
1051
|
|
|
|
|
|
|
if(inf_or_nan) { |
1052
|
|
|
|
|
|
|
if(inf_or_nan == 2) { |
1053
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) = _get_nan(); |
1054
|
|
|
|
|
|
|
return a; |
1055
|
|
|
|
|
|
|
} |
1056
|
|
|
|
|
|
|
|
1057
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) -= _get_inf(inf_or_nan); |
1058
|
|
|
|
|
|
|
return a; |
1059
|
|
|
|
|
|
|
} |
1060
|
|
|
|
|
|
|
|
1061
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) -= strtoflt128(SvPV_nolen(b), &p); |
1062
|
|
|
|
|
|
|
_nnum_inc(p); |
1063
|
|
|
|
|
|
|
return a; |
1064
|
|
|
|
|
|
|
#else |
1065
|
|
|
|
|
|
|
|
1066
|
5
|
50
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) -= strtoflt128(SvPV_nolen(b), &p); |
1067
|
5
|
|
|
|
|
|
_nnum_inc(p); |
1068
|
5
|
|
|
|
|
|
return a; |
1069
|
|
|
|
|
|
|
#endif |
1070
|
|
|
|
|
|
|
} |
1071
|
|
|
|
|
|
|
|
1072
|
|
|
|
|
|
|
|
1073
|
6
|
100
|
|
|
|
|
if(SvNOK(b)) { |
1074
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
1075
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
1076
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) -= _get_inf(SvNVX(b) > 0 ? 1 : -1); |
1077
|
|
|
|
|
|
|
return a; |
1078
|
|
|
|
|
|
|
} |
1079
|
|
|
|
|
|
|
#endif |
1080
|
4
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) -= (float128)SvNVX(b); |
1081
|
4
|
|
|
|
|
|
return a; |
1082
|
|
|
|
|
|
|
} |
1083
|
|
|
|
|
|
|
|
1084
|
2
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
1085
|
2
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1086
|
2
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
1087
|
2
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) -= *(INT2PTR(float128 *, SvIVX(SvRV(b)))); |
1088
|
2
|
|
|
|
|
|
return a; |
1089
|
|
|
|
|
|
|
} |
1090
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
1091
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_sub_eq function"); |
1092
|
|
|
|
|
|
|
} |
1093
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
1094
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_sub_eq function"); |
1095
|
|
|
|
|
|
|
} |
1096
|
|
|
|
|
|
|
|
1097
|
13
|
|
|
|
|
|
SV * _overload_div_eq(pTHX_ SV * a, SV * b, SV * third) { |
1098
|
|
|
|
|
|
|
|
1099
|
13
|
|
|
|
|
|
SvREFCNT_inc(a); |
1100
|
|
|
|
|
|
|
|
1101
|
13
|
100
|
|
|
|
|
if(SvUOK(b)) { |
1102
|
1
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) /= (float128)SvUVX(b); |
1103
|
1
|
|
|
|
|
|
return a; |
1104
|
|
|
|
|
|
|
} |
1105
|
|
|
|
|
|
|
|
1106
|
12
|
100
|
|
|
|
|
if(SvIOK(b)) { |
1107
|
1
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) /= (float128)SvIVX(b); |
1108
|
1
|
|
|
|
|
|
return a; |
1109
|
|
|
|
|
|
|
} |
1110
|
|
|
|
|
|
|
|
1111
|
11
|
100
|
|
|
|
|
if(SvPOK(b)) { |
1112
|
|
|
|
|
|
|
char * p; |
1113
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1114
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
1115
|
|
|
|
|
|
|
#endif |
1116
|
|
|
|
|
|
|
|
1117
|
5
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_div_eq");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1118
|
|
|
|
|
|
|
|
1119
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1120
|
|
|
|
|
|
|
|
1121
|
|
|
|
|
|
|
if(inf_or_nan) { |
1122
|
|
|
|
|
|
|
if(inf_or_nan == 2) { |
1123
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) = _get_nan(); |
1124
|
|
|
|
|
|
|
return a; |
1125
|
|
|
|
|
|
|
} |
1126
|
|
|
|
|
|
|
|
1127
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) /= _get_inf(inf_or_nan); |
1128
|
|
|
|
|
|
|
return a; |
1129
|
|
|
|
|
|
|
} |
1130
|
|
|
|
|
|
|
|
1131
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) /= strtoflt128(SvPV_nolen(b), &p); |
1132
|
|
|
|
|
|
|
_nnum_inc(p); |
1133
|
|
|
|
|
|
|
return a; |
1134
|
|
|
|
|
|
|
#else |
1135
|
|
|
|
|
|
|
|
1136
|
5
|
50
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) /= strtoflt128(SvPV_nolen(b), &p); |
1137
|
5
|
|
|
|
|
|
_nnum_inc(p); |
1138
|
5
|
|
|
|
|
|
return a; |
1139
|
|
|
|
|
|
|
#endif |
1140
|
|
|
|
|
|
|
} |
1141
|
|
|
|
|
|
|
|
1142
|
6
|
100
|
|
|
|
|
if(SvNOK(b)) { |
1143
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
1144
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
1145
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) /= _get_inf(SvNVX(b) > 0 ? 1 : -1); |
1146
|
|
|
|
|
|
|
return a; |
1147
|
|
|
|
|
|
|
} |
1148
|
|
|
|
|
|
|
#endif |
1149
|
4
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) /= (float128)SvNVX(b); |
1150
|
4
|
|
|
|
|
|
return a; |
1151
|
|
|
|
|
|
|
} |
1152
|
|
|
|
|
|
|
|
1153
|
2
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
1154
|
2
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1155
|
2
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
1156
|
2
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) /= *(INT2PTR(float128 *, SvIVX(SvRV(b)))); |
1157
|
2
|
|
|
|
|
|
return a; |
1158
|
|
|
|
|
|
|
} |
1159
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
1160
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_div_eq function"); |
1161
|
|
|
|
|
|
|
} |
1162
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
1163
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_div_eq function"); |
1164
|
|
|
|
|
|
|
} |
1165
|
|
|
|
|
|
|
|
1166
|
46
|
|
|
|
|
|
SV * _overload_lt(pTHX_ SV * a, SV * b, SV * third) { |
1167
|
|
|
|
|
|
|
|
1168
|
46
|
100
|
|
|
|
|
if(SvUOK(b)) { |
1169
|
2
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1170
|
1
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > (float128)SvUVX(b)) return newSViv(1); |
1171
|
0
|
|
|
|
|
|
return newSViv(0); |
1172
|
|
|
|
|
|
|
} |
1173
|
1
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < (float128)SvUVX(b)) return newSViv(1); |
1174
|
0
|
|
|
|
|
|
return newSViv(0); |
1175
|
|
|
|
|
|
|
} |
1176
|
|
|
|
|
|
|
|
1177
|
44
|
100
|
|
|
|
|
if(SvIOK(b)) { |
1178
|
8
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1179
|
2
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > (float128)SvIVX(b)) return newSViv(1); |
1180
|
0
|
|
|
|
|
|
return newSViv(0); |
1181
|
|
|
|
|
|
|
} |
1182
|
6
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < (float128)SvIVX(b)) return newSViv(1); |
1183
|
0
|
|
|
|
|
|
return newSViv(0); |
1184
|
|
|
|
|
|
|
} |
1185
|
|
|
|
|
|
|
|
1186
|
36
|
100
|
|
|
|
|
if(SvPOK(b)) { |
1187
|
|
|
|
|
|
|
char * p; |
1188
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1189
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
1190
|
|
|
|
|
|
|
#endif |
1191
|
|
|
|
|
|
|
|
1192
|
11
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_lt");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1193
|
|
|
|
|
|
|
|
1194
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1195
|
|
|
|
|
|
|
if(inf_or_nan) { |
1196
|
|
|
|
|
|
|
if(inf_or_nan == 2) return newSViv(0); |
1197
|
|
|
|
|
|
|
if(SWITCH_ARGS) { |
1198
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > _get_inf(inf_or_nan)) return newSViv(1); |
1199
|
|
|
|
|
|
|
return newSViv(0); |
1200
|
|
|
|
|
|
|
} |
1201
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < _get_inf(inf_or_nan)) return newSViv(1); |
1202
|
|
|
|
|
|
|
return newSViv(0); |
1203
|
|
|
|
|
|
|
} |
1204
|
|
|
|
|
|
|
if(SWITCH_ARGS) { |
1205
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > strtoflt128(SvPV_nolen(b), &p)) { |
1206
|
|
|
|
|
|
|
_nnum_inc(p); |
1207
|
|
|
|
|
|
|
return newSViv(1); |
1208
|
|
|
|
|
|
|
} |
1209
|
|
|
|
|
|
|
_nnum_inc(p); |
1210
|
|
|
|
|
|
|
return newSViv(0); |
1211
|
|
|
|
|
|
|
} |
1212
|
|
|
|
|
|
|
|
1213
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < strtoflt128(SvPV_nolen(b), &p)) { |
1214
|
|
|
|
|
|
|
_nnum_inc(p); |
1215
|
|
|
|
|
|
|
return newSViv(1); |
1216
|
|
|
|
|
|
|
} |
1217
|
|
|
|
|
|
|
_nnum_inc(p); |
1218
|
|
|
|
|
|
|
return newSViv(0); |
1219
|
|
|
|
|
|
|
#else |
1220
|
|
|
|
|
|
|
|
1221
|
11
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1222
|
1
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > strtoflt128(SvPV_nolen(b), &p)) { |
|
|
50
|
|
|
|
|
|
1223
|
1
|
|
|
|
|
|
_nnum_inc(p); |
1224
|
1
|
|
|
|
|
|
return newSViv(1); |
1225
|
|
|
|
|
|
|
} |
1226
|
0
|
|
|
|
|
|
_nnum_inc(p); |
1227
|
0
|
|
|
|
|
|
return newSViv(0); |
1228
|
|
|
|
|
|
|
} |
1229
|
|
|
|
|
|
|
|
1230
|
10
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < strtoflt128(SvPV_nolen(b), &p)) { |
|
|
100
|
|
|
|
|
|
1231
|
8
|
|
|
|
|
|
_nnum_inc(p); |
1232
|
8
|
|
|
|
|
|
return newSViv(1); |
1233
|
|
|
|
|
|
|
} |
1234
|
2
|
|
|
|
|
|
_nnum_inc(p); |
1235
|
11
|
|
|
|
|
|
return newSViv(0); |
1236
|
|
|
|
|
|
|
#endif |
1237
|
|
|
|
|
|
|
} |
1238
|
|
|
|
|
|
|
|
1239
|
25
|
100
|
|
|
|
|
if(SvNOK(b)) { |
1240
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
1241
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
1242
|
|
|
|
|
|
|
if(SWITCH_ARGS) { |
1243
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > _get_inf(SvNVX(b) > 0 ? 1 : -1)) |
1244
|
|
|
|
|
|
|
return newSViv(1); |
1245
|
|
|
|
|
|
|
return newSViv(0); |
1246
|
|
|
|
|
|
|
} |
1247
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < _get_inf(SvNVX(b) > 0 ? 1 : -1)) |
1248
|
|
|
|
|
|
|
return newSViv(1); |
1249
|
|
|
|
|
|
|
return newSViv(0); |
1250
|
|
|
|
|
|
|
} |
1251
|
|
|
|
|
|
|
#endif |
1252
|
21
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1253
|
2
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > (float128)SvNVX(b)) return newSViv(1); |
1254
|
1
|
|
|
|
|
|
return newSViv(0); |
1255
|
|
|
|
|
|
|
} |
1256
|
19
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < (float128)SvNVX(b)) return newSViv(1); |
1257
|
4
|
|
|
|
|
|
return newSViv(0); |
1258
|
|
|
|
|
|
|
} |
1259
|
|
|
|
|
|
|
|
1260
|
4
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
1261
|
4
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1262
|
4
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
1263
|
4
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < *(INT2PTR(float128 *, SvIVX(SvRV(b))))) return newSViv(1); |
1264
|
0
|
|
|
|
|
|
return newSViv(0); |
1265
|
|
|
|
|
|
|
} |
1266
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_lt function"); |
1267
|
|
|
|
|
|
|
} |
1268
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_lt function"); |
1269
|
|
|
|
|
|
|
} |
1270
|
|
|
|
|
|
|
|
1271
|
81
|
|
|
|
|
|
SV * _overload_gt(pTHX_ SV * a, SV * b, SV * third) { |
1272
|
|
|
|
|
|
|
|
1273
|
81
|
100
|
|
|
|
|
if(SvUOK(b)) { |
1274
|
2
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1275
|
1
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < (float128)SvUVX(b)) return newSViv(1); |
1276
|
0
|
|
|
|
|
|
return newSViv(0); |
1277
|
|
|
|
|
|
|
} |
1278
|
1
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > (float128)SvUVX(b)) return newSViv(1); |
1279
|
0
|
|
|
|
|
|
return newSViv(0); |
1280
|
|
|
|
|
|
|
} |
1281
|
|
|
|
|
|
|
|
1282
|
79
|
100
|
|
|
|
|
if(SvIOK(b)) { |
1283
|
12
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1284
|
2
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < (float128)SvIVX(b)) return newSViv(1); |
1285
|
0
|
|
|
|
|
|
return newSViv(0); |
1286
|
|
|
|
|
|
|
} |
1287
|
10
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > (float128)SvIVX(b)) return newSViv(1); |
1288
|
0
|
|
|
|
|
|
return newSViv(0); |
1289
|
|
|
|
|
|
|
} |
1290
|
|
|
|
|
|
|
|
1291
|
67
|
100
|
|
|
|
|
if(SvPOK(b)) { |
1292
|
|
|
|
|
|
|
char * p; |
1293
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1294
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
1295
|
|
|
|
|
|
|
#endif |
1296
|
|
|
|
|
|
|
|
1297
|
11
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_gt");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1298
|
|
|
|
|
|
|
|
1299
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1300
|
|
|
|
|
|
|
if(inf_or_nan) { |
1301
|
|
|
|
|
|
|
if(inf_or_nan == 2) return newSViv(0); |
1302
|
|
|
|
|
|
|
if(SWITCH_ARGS) { |
1303
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < _get_inf(inf_or_nan)) return newSViv(1); |
1304
|
|
|
|
|
|
|
return newSViv(0); |
1305
|
|
|
|
|
|
|
} |
1306
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > _get_inf(inf_or_nan)) return newSViv(1); |
1307
|
|
|
|
|
|
|
return newSViv(0); |
1308
|
|
|
|
|
|
|
} |
1309
|
|
|
|
|
|
|
if(SWITCH_ARGS) { |
1310
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < strtoflt128(SvPV_nolen(b), &p)) { |
1311
|
|
|
|
|
|
|
_nnum_inc(p); |
1312
|
|
|
|
|
|
|
return newSViv(1); |
1313
|
|
|
|
|
|
|
} |
1314
|
|
|
|
|
|
|
_nnum_inc(p); |
1315
|
|
|
|
|
|
|
return newSViv(0); |
1316
|
|
|
|
|
|
|
} |
1317
|
|
|
|
|
|
|
|
1318
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > strtoflt128(SvPV_nolen(b), &p)) { |
1319
|
|
|
|
|
|
|
_nnum_inc(p); |
1320
|
|
|
|
|
|
|
return newSViv(1); |
1321
|
|
|
|
|
|
|
} |
1322
|
|
|
|
|
|
|
_nnum_inc(p); |
1323
|
|
|
|
|
|
|
return newSViv(0); |
1324
|
|
|
|
|
|
|
#else |
1325
|
11
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1326
|
1
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < strtoflt128(SvPV_nolen(b), &p)) { |
|
|
50
|
|
|
|
|
|
1327
|
1
|
|
|
|
|
|
_nnum_inc(p); |
1328
|
1
|
|
|
|
|
|
return newSViv(1); |
1329
|
|
|
|
|
|
|
} |
1330
|
0
|
|
|
|
|
|
_nnum_inc(p); |
1331
|
0
|
|
|
|
|
|
return newSViv(0); |
1332
|
|
|
|
|
|
|
} |
1333
|
|
|
|
|
|
|
|
1334
|
10
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > strtoflt128(SvPV_nolen(b), &p)) { |
|
|
100
|
|
|
|
|
|
1335
|
6
|
|
|
|
|
|
_nnum_inc(p); |
1336
|
6
|
|
|
|
|
|
return newSViv(1); |
1337
|
|
|
|
|
|
|
} |
1338
|
4
|
|
|
|
|
|
_nnum_inc(p); |
1339
|
11
|
|
|
|
|
|
return newSViv(0); |
1340
|
|
|
|
|
|
|
#endif |
1341
|
|
|
|
|
|
|
} |
1342
|
|
|
|
|
|
|
|
1343
|
56
|
100
|
|
|
|
|
if(SvNOK(b)) { |
1344
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
1345
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
1346
|
|
|
|
|
|
|
if(SWITCH_ARGS) { |
1347
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < _get_inf(SvNVX(b) > 0 ? 1 : -1)) |
1348
|
|
|
|
|
|
|
return newSViv(1); |
1349
|
|
|
|
|
|
|
return newSViv(0); |
1350
|
|
|
|
|
|
|
} |
1351
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > _get_inf(SvNVX(b) > 0 ? 1 : -1)) |
1352
|
|
|
|
|
|
|
return newSViv(1); |
1353
|
|
|
|
|
|
|
return newSViv(0); |
1354
|
|
|
|
|
|
|
} |
1355
|
|
|
|
|
|
|
#endif |
1356
|
16
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1357
|
2
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < (float128)SvNVX(b)) return newSViv(1); |
1358
|
1
|
|
|
|
|
|
return newSViv(0); |
1359
|
|
|
|
|
|
|
} |
1360
|
14
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > (float128)SvNVX(b)) return newSViv(1); |
1361
|
3
|
|
|
|
|
|
return newSViv(0); |
1362
|
|
|
|
|
|
|
} |
1363
|
|
|
|
|
|
|
|
1364
|
40
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
1365
|
40
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1366
|
40
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
1367
|
40
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > *(INT2PTR(float128 *, SvIVX(SvRV(b))))) return newSViv(1); |
1368
|
36
|
|
|
|
|
|
return newSViv(0); |
1369
|
|
|
|
|
|
|
} |
1370
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_gt function"); |
1371
|
|
|
|
|
|
|
} |
1372
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_gt function"); |
1373
|
|
|
|
|
|
|
} |
1374
|
|
|
|
|
|
|
|
1375
|
40
|
|
|
|
|
|
SV * _overload_lte(pTHX_ SV * a, SV * b, SV * third) { |
1376
|
|
|
|
|
|
|
|
1377
|
40
|
100
|
|
|
|
|
if(SvUOK(b)) { |
1378
|
4
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1379
|
2
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= (float128)SvUVX(b)) return newSViv(1); |
1380
|
0
|
|
|
|
|
|
return newSViv(0); |
1381
|
|
|
|
|
|
|
} |
1382
|
2
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= (float128)SvUVX(b)) return newSViv(1); |
1383
|
0
|
|
|
|
|
|
return newSViv(0); |
1384
|
|
|
|
|
|
|
} |
1385
|
|
|
|
|
|
|
|
1386
|
36
|
100
|
|
|
|
|
if(SvIOK(b)) { |
1387
|
6
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1388
|
3
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= (float128)SvIVX(b)) return newSViv(1); |
1389
|
0
|
|
|
|
|
|
return newSViv(0); |
1390
|
|
|
|
|
|
|
} |
1391
|
3
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= (float128)SvIVX(b)) return newSViv(1); |
1392
|
0
|
|
|
|
|
|
return newSViv(0); |
1393
|
|
|
|
|
|
|
} |
1394
|
|
|
|
|
|
|
|
1395
|
30
|
100
|
|
|
|
|
if(SvPOK(b)) { |
1396
|
|
|
|
|
|
|
char * p; |
1397
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1398
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
1399
|
|
|
|
|
|
|
#endif |
1400
|
|
|
|
|
|
|
|
1401
|
9
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_lte");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1402
|
|
|
|
|
|
|
|
1403
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1404
|
|
|
|
|
|
|
if(inf_or_nan) { |
1405
|
|
|
|
|
|
|
if(inf_or_nan == 2) return newSViv(0); |
1406
|
|
|
|
|
|
|
if(SWITCH_ARGS) { |
1407
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= _get_inf(inf_or_nan)) return newSViv(1); |
1408
|
|
|
|
|
|
|
return newSViv(0); |
1409
|
|
|
|
|
|
|
} |
1410
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= _get_inf(inf_or_nan)) return newSViv(1); |
1411
|
|
|
|
|
|
|
return newSViv(0); |
1412
|
|
|
|
|
|
|
} |
1413
|
|
|
|
|
|
|
if(SWITCH_ARGS) { |
1414
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= strtoflt128(SvPV_nolen(b), &p)) { |
1415
|
|
|
|
|
|
|
_nnum_inc(p); |
1416
|
|
|
|
|
|
|
return newSViv(1); |
1417
|
|
|
|
|
|
|
} |
1418
|
|
|
|
|
|
|
_nnum_inc(p); |
1419
|
|
|
|
|
|
|
return newSViv(0); |
1420
|
|
|
|
|
|
|
} |
1421
|
|
|
|
|
|
|
|
1422
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= strtoflt128(SvPV_nolen(b), &p)) { |
1423
|
|
|
|
|
|
|
_nnum_inc(p); |
1424
|
|
|
|
|
|
|
return newSViv(1); |
1425
|
|
|
|
|
|
|
} |
1426
|
|
|
|
|
|
|
_nnum_inc(p); |
1427
|
|
|
|
|
|
|
return newSViv(0); |
1428
|
|
|
|
|
|
|
#else |
1429
|
9
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1430
|
2
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= strtoflt128(SvPV_nolen(b), &p)) { |
|
|
50
|
|
|
|
|
|
1431
|
2
|
|
|
|
|
|
_nnum_inc(p); |
1432
|
2
|
|
|
|
|
|
return newSViv(1); |
1433
|
|
|
|
|
|
|
} |
1434
|
0
|
|
|
|
|
|
_nnum_inc(p); |
1435
|
0
|
|
|
|
|
|
return newSViv(0); |
1436
|
|
|
|
|
|
|
} |
1437
|
7
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= strtoflt128(SvPV_nolen(b), &p)) { |
|
|
100
|
|
|
|
|
|
1438
|
5
|
|
|
|
|
|
_nnum_inc(p); |
1439
|
5
|
|
|
|
|
|
return newSViv(1); |
1440
|
|
|
|
|
|
|
} |
1441
|
2
|
|
|
|
|
|
_nnum_inc(p); |
1442
|
9
|
|
|
|
|
|
return newSViv(0); |
1443
|
|
|
|
|
|
|
#endif |
1444
|
|
|
|
|
|
|
} |
1445
|
|
|
|
|
|
|
|
1446
|
21
|
100
|
|
|
|
|
if(SvNOK(b)) { |
1447
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
1448
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
1449
|
|
|
|
|
|
|
if(SWITCH_ARGS) { |
1450
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= _get_inf(SvNVX(b) > 0 ? 1 : -1)) |
1451
|
|
|
|
|
|
|
return newSViv(1); |
1452
|
|
|
|
|
|
|
return newSViv(0); |
1453
|
|
|
|
|
|
|
} |
1454
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= _get_inf(SvNVX(b) > 0 ? 1 : -1)) |
1455
|
|
|
|
|
|
|
return newSViv(1); |
1456
|
|
|
|
|
|
|
return newSViv(0); |
1457
|
|
|
|
|
|
|
} |
1458
|
|
|
|
|
|
|
#endif |
1459
|
12
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1460
|
3
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= (float128)SvNVX(b)) return newSViv(1); |
1461
|
1
|
|
|
|
|
|
return newSViv(0); |
1462
|
|
|
|
|
|
|
} |
1463
|
9
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= (float128)SvNVX(b)) return newSViv(1); |
1464
|
4
|
|
|
|
|
|
return newSViv(0); |
1465
|
|
|
|
|
|
|
} |
1466
|
|
|
|
|
|
|
|
1467
|
9
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
1468
|
9
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1469
|
9
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
1470
|
9
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= *(INT2PTR(float128 *, SvIVX(SvRV(b))))) return newSViv(1); |
1471
|
0
|
|
|
|
|
|
return newSViv(0); |
1472
|
|
|
|
|
|
|
} |
1473
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_lte function"); |
1474
|
|
|
|
|
|
|
} |
1475
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_lte function"); |
1476
|
|
|
|
|
|
|
} |
1477
|
|
|
|
|
|
|
|
1478
|
37
|
|
|
|
|
|
SV * _overload_gte(pTHX_ SV * a, SV * b, SV * third) { |
1479
|
|
|
|
|
|
|
|
1480
|
37
|
100
|
|
|
|
|
if(SvUOK(b)) { |
1481
|
4
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1482
|
2
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= (float128)SvUVX(b)) return newSViv(1); |
1483
|
0
|
|
|
|
|
|
return newSViv(0); |
1484
|
|
|
|
|
|
|
} |
1485
|
2
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= (float128)SvUVX(b)) return newSViv(1); |
1486
|
0
|
|
|
|
|
|
return newSViv(0); |
1487
|
|
|
|
|
|
|
} |
1488
|
|
|
|
|
|
|
|
1489
|
33
|
100
|
|
|
|
|
if(SvIOK(b)) { |
1490
|
6
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1491
|
3
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= (float128)SvIVX(b)) return newSViv(1); |
1492
|
0
|
|
|
|
|
|
return newSViv(0); |
1493
|
|
|
|
|
|
|
} |
1494
|
3
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= (float128)SvIVX(b)) return newSViv(1); |
1495
|
0
|
|
|
|
|
|
return newSViv(0); |
1496
|
|
|
|
|
|
|
} |
1497
|
|
|
|
|
|
|
|
1498
|
27
|
100
|
|
|
|
|
if(SvPOK(b)) { |
1499
|
|
|
|
|
|
|
char * p; |
1500
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1501
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
1502
|
|
|
|
|
|
|
#endif |
1503
|
|
|
|
|
|
|
|
1504
|
9
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_gte");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1505
|
|
|
|
|
|
|
|
1506
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1507
|
|
|
|
|
|
|
if(inf_or_nan) { |
1508
|
|
|
|
|
|
|
if(inf_or_nan == 2) return newSViv(0); |
1509
|
|
|
|
|
|
|
if(SWITCH_ARGS) { |
1510
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= _get_inf(inf_or_nan)) return newSViv(1); |
1511
|
|
|
|
|
|
|
return newSViv(0); |
1512
|
|
|
|
|
|
|
} |
1513
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= _get_inf(inf_or_nan)) return newSViv(1); |
1514
|
|
|
|
|
|
|
return newSViv(0); |
1515
|
|
|
|
|
|
|
} |
1516
|
|
|
|
|
|
|
if(SWITCH_ARGS) { |
1517
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= strtoflt128(SvPV_nolen(b), &p)) { |
1518
|
|
|
|
|
|
|
_nnum_inc(p); |
1519
|
|
|
|
|
|
|
return newSViv(1); |
1520
|
|
|
|
|
|
|
} |
1521
|
|
|
|
|
|
|
_nnum_inc(p); |
1522
|
|
|
|
|
|
|
return newSViv(0); |
1523
|
|
|
|
|
|
|
} |
1524
|
|
|
|
|
|
|
|
1525
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= strtoflt128(SvPV_nolen(b), &p)) { |
1526
|
|
|
|
|
|
|
_nnum_inc(p); |
1527
|
|
|
|
|
|
|
return newSViv(1); |
1528
|
|
|
|
|
|
|
} |
1529
|
|
|
|
|
|
|
_nnum_inc(p); |
1530
|
|
|
|
|
|
|
return newSViv(0); |
1531
|
|
|
|
|
|
|
#else |
1532
|
|
|
|
|
|
|
|
1533
|
9
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1534
|
2
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= strtoflt128(SvPV_nolen(b), &p)) { |
|
|
50
|
|
|
|
|
|
1535
|
2
|
|
|
|
|
|
_nnum_inc(p); |
1536
|
2
|
|
|
|
|
|
return newSViv(1); |
1537
|
|
|
|
|
|
|
} |
1538
|
0
|
|
|
|
|
|
_nnum_inc(p); |
1539
|
0
|
|
|
|
|
|
return newSViv(0); |
1540
|
|
|
|
|
|
|
} |
1541
|
|
|
|
|
|
|
|
1542
|
7
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= strtoflt128(SvPV_nolen(b), &p)) { |
|
|
100
|
|
|
|
|
|
1543
|
3
|
|
|
|
|
|
_nnum_inc(p); |
1544
|
3
|
|
|
|
|
|
return newSViv(1); |
1545
|
|
|
|
|
|
|
} |
1546
|
4
|
|
|
|
|
|
_nnum_inc(p); |
1547
|
9
|
|
|
|
|
|
return newSViv(0); |
1548
|
|
|
|
|
|
|
#endif |
1549
|
|
|
|
|
|
|
} |
1550
|
|
|
|
|
|
|
|
1551
|
|
|
|
|
|
|
|
1552
|
18
|
100
|
|
|
|
|
if(SvNOK(b)) { |
1553
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
1554
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
1555
|
|
|
|
|
|
|
if(SWITCH_ARGS) { |
1556
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= _get_inf(SvNVX(b) > 0 ? 1 : -1)) |
1557
|
|
|
|
|
|
|
return newSViv(1); |
1558
|
|
|
|
|
|
|
return newSViv(0); |
1559
|
|
|
|
|
|
|
} |
1560
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= _get_inf(SvNVX(b) > 0 ? 1 : -1)) |
1561
|
|
|
|
|
|
|
return newSViv(1); |
1562
|
|
|
|
|
|
|
return newSViv(0); |
1563
|
|
|
|
|
|
|
} |
1564
|
|
|
|
|
|
|
#endif |
1565
|
12
|
50
|
|
|
|
|
if(SWITCH_ARGS) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1566
|
3
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) <= (float128)SvNVX(b)) return newSViv(1); |
1567
|
1
|
|
|
|
|
|
return newSViv(0); |
1568
|
|
|
|
|
|
|
} |
1569
|
9
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= (float128)SvNVX(b)) return newSViv(1); |
1570
|
3
|
|
|
|
|
|
return newSViv(0); |
1571
|
|
|
|
|
|
|
} |
1572
|
|
|
|
|
|
|
|
1573
|
6
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
1574
|
6
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1575
|
6
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
1576
|
6
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) >= *(INT2PTR(float128 *, SvIVX(SvRV(b))))) return newSViv(1); |
1577
|
0
|
|
|
|
|
|
return newSViv(0); |
1578
|
|
|
|
|
|
|
} |
1579
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_gte function"); |
1580
|
|
|
|
|
|
|
} |
1581
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_gte function"); |
1582
|
|
|
|
|
|
|
} |
1583
|
|
|
|
|
|
|
|
1584
|
65
|
|
|
|
|
|
SV * _overload_spaceship(pTHX_ SV * a, SV * b, SV * third) { |
1585
|
65
|
|
|
|
|
|
int reversal = 1; |
1586
|
65
|
50
|
|
|
|
|
if(SWITCH_ARGS) reversal = -1; |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1587
|
|
|
|
|
|
|
|
1588
|
65
|
100
|
|
|
|
|
if(SvUOK(b)) { |
1589
|
10
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == (float128)SvUVX(b)) return newSViv( 0 * reversal); |
1590
|
6
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < (float128)SvUVX(b)) return newSViv(-1 * reversal); |
1591
|
4
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > (float128)SvUVX(b)) return newSViv( 1 * reversal); |
1592
|
2
|
|
|
|
|
|
return &PL_sv_undef; /* it's a nan */ |
1593
|
|
|
|
|
|
|
} |
1594
|
|
|
|
|
|
|
|
1595
|
55
|
100
|
|
|
|
|
if(SvIOK(b)) { |
1596
|
12
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == (float128)SvIVX(b)) return newSViv( 0); |
1597
|
8
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < (float128)SvIVX(b)) return newSViv(-1 * reversal); |
1598
|
4
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > (float128)SvIVX(b)) return newSViv( 1 * reversal); |
1599
|
2
|
|
|
|
|
|
return &PL_sv_undef; /* it's a nan */ |
1600
|
|
|
|
|
|
|
} |
1601
|
|
|
|
|
|
|
|
1602
|
43
|
100
|
|
|
|
|
if(SvPOK(b)) { |
1603
|
|
|
|
|
|
|
char *p; |
1604
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1605
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
1606
|
|
|
|
|
|
|
#endif |
1607
|
|
|
|
|
|
|
|
1608
|
15
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_spaceship");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1609
|
|
|
|
|
|
|
|
1610
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1611
|
|
|
|
|
|
|
|
1612
|
|
|
|
|
|
|
if(inf_or_nan) { |
1613
|
|
|
|
|
|
|
if(inf_or_nan == 2) return &PL_sv_undef; |
1614
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == _get_inf(inf_or_nan)) |
1615
|
|
|
|
|
|
|
return newSViv(0); |
1616
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < _get_inf(inf_or_nan)) |
1617
|
|
|
|
|
|
|
return newSViv(-1 * reversal); |
1618
|
|
|
|
|
|
|
return newSViv(reversal); |
1619
|
|
|
|
|
|
|
} |
1620
|
|
|
|
|
|
|
|
1621
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == strtoflt128(SvPV_nolen(b), &p)) { |
1622
|
|
|
|
|
|
|
_nnum_inc(p); |
1623
|
|
|
|
|
|
|
return newSViv( 0); |
1624
|
|
|
|
|
|
|
} |
1625
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < strtoflt128(SvPV_nolen(b), &p)) { |
1626
|
|
|
|
|
|
|
_nnum_inc(p); |
1627
|
|
|
|
|
|
|
return newSViv(-1 * reversal); |
1628
|
|
|
|
|
|
|
} |
1629
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > strtoflt128(SvPV_nolen(b), &p)) { |
1630
|
|
|
|
|
|
|
_nnum_inc(p); |
1631
|
|
|
|
|
|
|
return newSViv(reversal); |
1632
|
|
|
|
|
|
|
} |
1633
|
|
|
|
|
|
|
return &PL_sv_undef; /* it's a nan */ |
1634
|
|
|
|
|
|
|
#else |
1635
|
15
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == strtoflt128(SvPV_nolen(b), &p)) { |
|
|
100
|
|
|
|
|
|
1636
|
4
|
|
|
|
|
|
_nnum_inc(p); |
1637
|
4
|
|
|
|
|
|
return newSViv( 0); |
1638
|
|
|
|
|
|
|
} |
1639
|
11
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < strtoflt128(SvPV_nolen(b), &p)) { |
|
|
100
|
|
|
|
|
|
1640
|
5
|
|
|
|
|
|
_nnum_inc(p); |
1641
|
5
|
|
|
|
|
|
return newSViv(-1 * reversal); |
1642
|
|
|
|
|
|
|
} |
1643
|
6
|
50
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > strtoflt128(SvPV_nolen(b), &p)) { |
|
|
100
|
|
|
|
|
|
1644
|
3
|
|
|
|
|
|
_nnum_inc(p); |
1645
|
3
|
|
|
|
|
|
return newSViv(reversal); |
1646
|
|
|
|
|
|
|
} |
1647
|
15
|
|
|
|
|
|
return &PL_sv_undef; /* it's a nan */ |
1648
|
|
|
|
|
|
|
#endif |
1649
|
|
|
|
|
|
|
} |
1650
|
|
|
|
|
|
|
|
1651
|
28
|
100
|
|
|
|
|
if(SvNOK(b)) { |
1652
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
1653
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
1654
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == _get_inf(SvNVX(b) > 0 ? 1 : -1)) |
1655
|
|
|
|
|
|
|
return newSViv(0); |
1656
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < _get_inf(SvNVX(b) > 0 ? 1 : -1)) |
1657
|
|
|
|
|
|
|
return newSViv(-1 * reversal); |
1658
|
|
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > _get_inf(SvNVX(b) > 0 ? 1 : -1)) |
1659
|
|
|
|
|
|
|
return newSViv(reversal); |
1660
|
|
|
|
|
|
|
} |
1661
|
|
|
|
|
|
|
#endif |
1662
|
15
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == (float128)SvNVX(b)) return newSViv( 0); |
1663
|
11
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < (float128)SvNVX(b)) return newSViv(-1 * reversal); |
1664
|
8
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > (float128)SvNVX(b)) return newSViv(reversal); |
1665
|
5
|
|
|
|
|
|
return &PL_sv_undef; /* it's a nan */ |
1666
|
|
|
|
|
|
|
} |
1667
|
|
|
|
|
|
|
|
1668
|
13
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
1669
|
13
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1670
|
13
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
1671
|
13
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) < *(INT2PTR(float128 *, SvIVX(SvRV(b))))) return newSViv(-1); |
1672
|
10
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) > *(INT2PTR(float128 *, SvIVX(SvRV(b))))) return newSViv(1); |
1673
|
7
|
100
|
|
|
|
|
if(*(INT2PTR(float128 *, SvIVX(SvRV(a)))) == *(INT2PTR(float128 *, SvIVX(SvRV(b))))) return newSViv(0); |
1674
|
2
|
|
|
|
|
|
return &PL_sv_undef; /* it's a nan */ |
1675
|
|
|
|
|
|
|
} |
1676
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_spaceship function"); |
1677
|
|
|
|
|
|
|
} |
1678
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_spaceship function"); |
1679
|
|
|
|
|
|
|
} |
1680
|
|
|
|
|
|
|
|
1681
|
1
|
|
|
|
|
|
SV * _overload_copy(pTHX_ SV * a, SV * b, SV * third) { |
1682
|
|
|
|
|
|
|
|
1683
|
|
|
|
|
|
|
float128 * ld; |
1684
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
1685
|
|
|
|
|
|
|
|
1686
|
1
|
|
|
|
|
|
Newx(ld, 1, float128); |
1687
|
1
|
50
|
|
|
|
|
if(ld == NULL) croak("Failed to allocate memory in _overload_copy function"); |
1688
|
|
|
|
|
|
|
|
1689
|
1
|
|
|
|
|
|
*ld = *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
1690
|
|
|
|
|
|
|
|
1691
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
1692
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
1693
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,ld)); |
1694
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
1695
|
1
|
|
|
|
|
|
return obj_ref; |
1696
|
|
|
|
|
|
|
} |
1697
|
|
|
|
|
|
|
|
1698
|
26
|
|
|
|
|
|
SV * F128toF128(pTHX_ SV * a) { |
1699
|
|
|
|
|
|
|
float128 * f; |
1700
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
1701
|
|
|
|
|
|
|
|
1702
|
26
|
50
|
|
|
|
|
if(sv_isobject(a)) { |
1703
|
26
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(a))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1704
|
26
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
1705
|
|
|
|
|
|
|
|
1706
|
26
|
|
|
|
|
|
Newx(f, 1, float128); |
1707
|
26
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in F128toF128 function"); |
1708
|
|
|
|
|
|
|
|
1709
|
26
|
|
|
|
|
|
*f = *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
1710
|
|
|
|
|
|
|
|
1711
|
26
|
|
|
|
|
|
obj_ref = newSV(0); |
1712
|
26
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
1713
|
26
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
1714
|
26
|
|
|
|
|
|
SvREADONLY_on(obj); |
1715
|
26
|
|
|
|
|
|
return obj_ref; |
1716
|
|
|
|
|
|
|
} |
1717
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::F128toF128 function"); |
1718
|
|
|
|
|
|
|
} |
1719
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::F128toF128 function"); |
1720
|
|
|
|
|
|
|
} |
1721
|
|
|
|
|
|
|
|
1722
|
1
|
|
|
|
|
|
void fromF128(pTHX_ float128 * f, SV * a) { |
1723
|
|
|
|
|
|
|
|
1724
|
1
|
50
|
|
|
|
|
if(sv_isobject(a)) { |
1725
|
1
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(a))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1726
|
1
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
1727
|
|
|
|
|
|
|
|
1728
|
1
|
|
|
|
|
|
*f = *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
1729
|
|
|
|
|
|
|
} |
1730
|
1
|
|
|
|
|
|
else croak("Invalid object supplied to Math::Float128::fromF128 function"); |
1731
|
|
|
|
|
|
|
} |
1732
|
0
|
|
|
|
|
|
else croak("Invalid argument supplied to Math::Float128::fromF128 function"); |
1733
|
1
|
|
|
|
|
|
} |
1734
|
|
|
|
|
|
|
|
1735
|
437
|
|
|
|
|
|
SV * _itsa(pTHX_ SV * a) { |
1736
|
437
|
100
|
|
|
|
|
if(SvUOK(a)) return newSVuv(1); |
1737
|
411
|
100
|
|
|
|
|
if(SvIOK(a)) return newSVuv(2); |
1738
|
264
|
100
|
|
|
|
|
if(SvPOK(a)) return newSVuv(4); |
1739
|
169
|
100
|
|
|
|
|
if(SvNOK(a)) return newSVuv(3); |
1740
|
28
|
50
|
|
|
|
|
if(sv_isobject(a)) { |
1741
|
28
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(a))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1742
|
28
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) return newSVuv(113); |
1743
|
|
|
|
|
|
|
} |
1744
|
0
|
|
|
|
|
|
return newSVuv(0); |
1745
|
|
|
|
|
|
|
} |
1746
|
|
|
|
|
|
|
|
1747
|
63
|
|
|
|
|
|
SV * _overload_abs(pTHX_ SV * a, SV * b, SV * third) { |
1748
|
|
|
|
|
|
|
|
1749
|
|
|
|
|
|
|
float128 * f; |
1750
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
1751
|
|
|
|
|
|
|
|
1752
|
63
|
|
|
|
|
|
Newx(f, 1, float128); |
1753
|
63
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _overload_abs function"); |
1754
|
|
|
|
|
|
|
|
1755
|
63
|
|
|
|
|
|
obj_ref = newSV(0); |
1756
|
63
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
1757
|
|
|
|
|
|
|
|
1758
|
63
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
1759
|
63
|
|
|
|
|
|
SvREADONLY_on(obj); |
1760
|
|
|
|
|
|
|
|
1761
|
63
|
|
|
|
|
|
*f = fabsq(*(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1762
|
63
|
|
|
|
|
|
return obj_ref; |
1763
|
|
|
|
|
|
|
} |
1764
|
|
|
|
|
|
|
|
1765
|
11
|
|
|
|
|
|
SV * _overload_int(pTHX_ SV * a, SV * b, SV * third) { |
1766
|
|
|
|
|
|
|
|
1767
|
|
|
|
|
|
|
float128 * f; |
1768
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
1769
|
|
|
|
|
|
|
|
1770
|
11
|
|
|
|
|
|
Newx(f, 1, float128); |
1771
|
11
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _overload_int function"); |
1772
|
|
|
|
|
|
|
|
1773
|
11
|
|
|
|
|
|
*f = *(INT2PTR(float128 *, SvIVX(SvRV(a)))); |
1774
|
|
|
|
|
|
|
|
1775
|
11
|
100
|
|
|
|
|
if(*f < 0.0Q) *f = ceilq(*f); |
1776
|
7
|
|
|
|
|
|
else *f = floorq(*f); |
1777
|
|
|
|
|
|
|
|
1778
|
11
|
|
|
|
|
|
obj_ref = newSV(0); |
1779
|
11
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
1780
|
11
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
1781
|
11
|
|
|
|
|
|
SvREADONLY_on(obj); |
1782
|
11
|
|
|
|
|
|
return obj_ref; |
1783
|
|
|
|
|
|
|
} |
1784
|
|
|
|
|
|
|
|
1785
|
4
|
|
|
|
|
|
SV * _overload_sqrt(pTHX_ SV * a, SV * b, SV * third) { |
1786
|
|
|
|
|
|
|
|
1787
|
|
|
|
|
|
|
float128 * f; |
1788
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
1789
|
|
|
|
|
|
|
|
1790
|
4
|
|
|
|
|
|
Newx(f, 1, float128); |
1791
|
4
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _overload_sqrt function"); |
1792
|
|
|
|
|
|
|
|
1793
|
4
|
|
|
|
|
|
*f = sqrtq(*(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1794
|
|
|
|
|
|
|
|
1795
|
4
|
|
|
|
|
|
obj_ref = newSV(0); |
1796
|
4
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
1797
|
4
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
1798
|
4
|
|
|
|
|
|
SvREADONLY_on(obj); |
1799
|
4
|
|
|
|
|
|
return obj_ref; |
1800
|
|
|
|
|
|
|
} |
1801
|
|
|
|
|
|
|
|
1802
|
4
|
|
|
|
|
|
SV * _overload_log(pTHX_ SV * a, SV * b, SV * third) { |
1803
|
|
|
|
|
|
|
|
1804
|
|
|
|
|
|
|
float128 * f; |
1805
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
1806
|
|
|
|
|
|
|
|
1807
|
4
|
|
|
|
|
|
Newx(f, 1, float128); |
1808
|
4
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _overload_log function"); |
1809
|
|
|
|
|
|
|
|
1810
|
4
|
|
|
|
|
|
*f = logq(*(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1811
|
|
|
|
|
|
|
|
1812
|
|
|
|
|
|
|
|
1813
|
4
|
|
|
|
|
|
obj_ref = newSV(0); |
1814
|
4
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
1815
|
4
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
1816
|
4
|
|
|
|
|
|
SvREADONLY_on(obj); |
1817
|
4
|
|
|
|
|
|
return obj_ref; |
1818
|
|
|
|
|
|
|
} |
1819
|
|
|
|
|
|
|
|
1820
|
1
|
|
|
|
|
|
SV * _overload_exp(pTHX_ SV * a, SV * b, SV * third) { |
1821
|
|
|
|
|
|
|
|
1822
|
|
|
|
|
|
|
float128 * f; |
1823
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
1824
|
|
|
|
|
|
|
|
1825
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
1826
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _overload_exp function"); |
1827
|
|
|
|
|
|
|
|
1828
|
|
|
|
|
|
|
#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 4 /* avoid calling expq() as it's buggy */ |
1829
|
|
|
|
|
|
|
*f = powq(M_Eq, *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1830
|
|
|
|
|
|
|
#else |
1831
|
1
|
|
|
|
|
|
*f = expq(*(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1832
|
|
|
|
|
|
|
#endif |
1833
|
|
|
|
|
|
|
|
1834
|
|
|
|
|
|
|
|
1835
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
1836
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
1837
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
1838
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
1839
|
1
|
|
|
|
|
|
return obj_ref; |
1840
|
|
|
|
|
|
|
} |
1841
|
|
|
|
|
|
|
|
1842
|
1
|
|
|
|
|
|
SV * _overload_sin(pTHX_ SV * a, SV * b, SV * third) { |
1843
|
|
|
|
|
|
|
|
1844
|
|
|
|
|
|
|
float128 * f; |
1845
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
1846
|
|
|
|
|
|
|
|
1847
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
1848
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _overload_sin function"); |
1849
|
|
|
|
|
|
|
|
1850
|
1
|
|
|
|
|
|
*f = sinq(*(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1851
|
|
|
|
|
|
|
|
1852
|
|
|
|
|
|
|
|
1853
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
1854
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
1855
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
1856
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
1857
|
1
|
|
|
|
|
|
return obj_ref; |
1858
|
|
|
|
|
|
|
} |
1859
|
|
|
|
|
|
|
|
1860
|
1
|
|
|
|
|
|
SV * _overload_cos(pTHX_ SV * a, SV * b, SV * third) { |
1861
|
|
|
|
|
|
|
|
1862
|
|
|
|
|
|
|
float128 * f; |
1863
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
1864
|
|
|
|
|
|
|
|
1865
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
1866
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _overload_cos function"); |
1867
|
|
|
|
|
|
|
|
1868
|
1
|
|
|
|
|
|
*f = cosq(*(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1869
|
|
|
|
|
|
|
|
1870
|
|
|
|
|
|
|
|
1871
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
1872
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
1873
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
1874
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
1875
|
1
|
|
|
|
|
|
return obj_ref; |
1876
|
|
|
|
|
|
|
} |
1877
|
|
|
|
|
|
|
|
1878
|
4
|
|
|
|
|
|
SV * _overload_atan2(pTHX_ SV * a, SV * b, SV * third) { |
1879
|
|
|
|
|
|
|
|
1880
|
|
|
|
|
|
|
float128 * f; |
1881
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
1882
|
|
|
|
|
|
|
|
1883
|
4
|
|
|
|
|
|
Newx(f, 1, float128); |
1884
|
4
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _overload_atan2 function"); |
1885
|
|
|
|
|
|
|
|
1886
|
4
|
|
|
|
|
|
obj_ref = newSV(0); |
1887
|
4
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
1888
|
4
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
1889
|
4
|
|
|
|
|
|
SvREADONLY_on(obj); |
1890
|
|
|
|
|
|
|
|
1891
|
4
|
50
|
|
|
|
|
if(SvUOK(b)) { |
1892
|
0
|
0
|
|
|
|
|
if(SWITCH_ARGS) |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1893
|
0
|
|
|
|
|
|
*f = atan2q((float128)SvUVX(b), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1894
|
0
|
|
|
|
|
|
else *f = atan2q(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), (float128)SvUVX(b)); |
1895
|
0
|
|
|
|
|
|
return obj_ref; |
1896
|
|
|
|
|
|
|
} |
1897
|
|
|
|
|
|
|
|
1898
|
4
|
50
|
|
|
|
|
if(SvIOK(b)) { |
1899
|
0
|
0
|
|
|
|
|
if(SWITCH_ARGS) |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1900
|
0
|
|
|
|
|
|
*f = atan2q((float128)SvIVX(b), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1901
|
0
|
|
|
|
|
|
else *f = atan2q(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), (float128)SvIVX(b)); |
1902
|
0
|
|
|
|
|
|
return obj_ref; |
1903
|
|
|
|
|
|
|
} |
1904
|
|
|
|
|
|
|
|
1905
|
4
|
100
|
|
|
|
|
if(SvPOK(b)) { |
1906
|
|
|
|
|
|
|
char * p; |
1907
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1908
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
1909
|
|
|
|
|
|
|
#endif |
1910
|
|
|
|
|
|
|
|
1911
|
1
|
50
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_atan2");} |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1912
|
|
|
|
|
|
|
|
1913
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
1914
|
|
|
|
|
|
|
|
1915
|
|
|
|
|
|
|
if(inf_or_nan) { |
1916
|
|
|
|
|
|
|
if(inf_or_nan == 2) { |
1917
|
|
|
|
|
|
|
if(SWITCH_ARGS) |
1918
|
|
|
|
|
|
|
*f = atan2q(_get_nan(), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1919
|
|
|
|
|
|
|
else *f = atan2q(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), _get_nan()); |
1920
|
|
|
|
|
|
|
} |
1921
|
|
|
|
|
|
|
else { |
1922
|
|
|
|
|
|
|
if(SWITCH_ARGS) |
1923
|
|
|
|
|
|
|
*f = atan2q(_get_inf(inf_or_nan), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1924
|
|
|
|
|
|
|
else *f = atan2q(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), _get_inf(inf_or_nan)); |
1925
|
|
|
|
|
|
|
} |
1926
|
|
|
|
|
|
|
} |
1927
|
|
|
|
|
|
|
else { |
1928
|
|
|
|
|
|
|
if(SWITCH_ARGS) |
1929
|
|
|
|
|
|
|
*f = atan2q(strtoflt128(SvPV_nolen(b), &p), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1930
|
|
|
|
|
|
|
else *f = atan2q(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), strtoflt128(SvPV_nolen(b), &p)); |
1931
|
|
|
|
|
|
|
_nnum_inc(p); |
1932
|
|
|
|
|
|
|
return obj_ref; |
1933
|
|
|
|
|
|
|
} |
1934
|
|
|
|
|
|
|
#else |
1935
|
1
|
50
|
|
|
|
|
if(SWITCH_ARGS) |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1936
|
1
|
50
|
|
|
|
|
*f = atan2q(strtoflt128(SvPV_nolen(b), &p), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1937
|
0
|
0
|
|
|
|
|
else *f = atan2q(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), strtoflt128(SvPV_nolen(b), &p)); |
1938
|
1
|
|
|
|
|
|
_nnum_inc(p); |
1939
|
1
|
|
|
|
|
|
return obj_ref; |
1940
|
|
|
|
|
|
|
#endif |
1941
|
|
|
|
|
|
|
} |
1942
|
|
|
|
|
|
|
|
1943
|
3
|
100
|
|
|
|
|
if(SvNOK(b)) { |
1944
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
1945
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
1946
|
|
|
|
|
|
|
if(SWITCH_ARGS) |
1947
|
|
|
|
|
|
|
*f = atan2q(_get_inf(SvNVX(b) > 0 ? 1 : -1), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1948
|
|
|
|
|
|
|
else *f = atan2q(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), _get_inf(SvNVX(b) > 0 ? 1 : -1)); |
1949
|
|
|
|
|
|
|
return obj_ref; |
1950
|
|
|
|
|
|
|
} |
1951
|
|
|
|
|
|
|
#endif |
1952
|
1
|
50
|
|
|
|
|
if(SWITCH_ARGS) |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1953
|
0
|
|
|
|
|
|
*f = atan2q((float128)SvNVX(b), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
1954
|
1
|
|
|
|
|
|
else *f = atan2q(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), (float128)SvNVX(b)); |
1955
|
1
|
|
|
|
|
|
return obj_ref; |
1956
|
|
|
|
|
|
|
} |
1957
|
|
|
|
|
|
|
|
1958
|
2
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
1959
|
2
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
1960
|
2
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
1961
|
2
|
|
|
|
|
|
*f = atan2q(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), *(INT2PTR(float128 *, SvIVX(SvRV(b))))); |
1962
|
2
|
|
|
|
|
|
return obj_ref; |
1963
|
|
|
|
|
|
|
} |
1964
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_atan2 function"); |
1965
|
|
|
|
|
|
|
} |
1966
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_atan2 function"); |
1967
|
|
|
|
|
|
|
} |
1968
|
|
|
|
|
|
|
|
1969
|
1
|
|
|
|
|
|
SV * _overload_inc(pTHX_ SV * a, SV * b, SV * third) { |
1970
|
|
|
|
|
|
|
|
1971
|
1
|
|
|
|
|
|
SvREFCNT_inc(a); |
1972
|
|
|
|
|
|
|
|
1973
|
1
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) += 1.0Q; |
1974
|
|
|
|
|
|
|
|
1975
|
1
|
|
|
|
|
|
return a; |
1976
|
|
|
|
|
|
|
} |
1977
|
|
|
|
|
|
|
|
1978
|
1
|
|
|
|
|
|
SV * _overload_dec(pTHX_ SV * a, SV * b, SV * third) { |
1979
|
|
|
|
|
|
|
|
1980
|
1
|
|
|
|
|
|
SvREFCNT_inc(a); |
1981
|
|
|
|
|
|
|
|
1982
|
1
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) -= 1.0Q; |
1983
|
|
|
|
|
|
|
|
1984
|
1
|
|
|
|
|
|
return a; |
1985
|
|
|
|
|
|
|
} |
1986
|
|
|
|
|
|
|
|
1987
|
16
|
|
|
|
|
|
SV * _overload_pow(pTHX_ SV * a, SV * b, SV * third) { |
1988
|
|
|
|
|
|
|
|
1989
|
|
|
|
|
|
|
float128 * f; |
1990
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
1991
|
|
|
|
|
|
|
|
1992
|
16
|
|
|
|
|
|
Newx(f, 1, float128); |
1993
|
16
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _overload_pow function"); |
1994
|
|
|
|
|
|
|
|
1995
|
16
|
|
|
|
|
|
obj_ref = newSV(0); |
1996
|
16
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
1997
|
16
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
1998
|
16
|
|
|
|
|
|
SvREADONLY_on(obj); |
1999
|
|
|
|
|
|
|
|
2000
|
16
|
100
|
|
|
|
|
if(SvUOK(b)) { |
2001
|
2
|
50
|
|
|
|
|
if(SWITCH_ARGS) |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
2002
|
2
|
|
|
|
|
|
*f = powq((float128)SvUVX(b), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
2003
|
0
|
|
|
|
|
|
else *f = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), (float128)SvUVX(b)); |
2004
|
2
|
|
|
|
|
|
return obj_ref; |
2005
|
|
|
|
|
|
|
} |
2006
|
|
|
|
|
|
|
|
2007
|
14
|
100
|
|
|
|
|
if(SvIOK(b)) { |
2008
|
5
|
50
|
|
|
|
|
if(SWITCH_ARGS) |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
2009
|
3
|
|
|
|
|
|
*f = powq((float128)SvIVX(b), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
2010
|
2
|
|
|
|
|
|
else *f = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), (float128)SvIVX(b)); |
2011
|
5
|
|
|
|
|
|
return obj_ref; |
2012
|
|
|
|
|
|
|
} |
2013
|
|
|
|
|
|
|
|
2014
|
9
|
100
|
|
|
|
|
if(SvPOK(b)) { |
2015
|
|
|
|
|
|
|
char * p; |
2016
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
2017
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
2018
|
|
|
|
|
|
|
#endif |
2019
|
|
|
|
|
|
|
|
2020
|
4
|
100
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_pow");} |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
2021
|
|
|
|
|
|
|
|
2022
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
2023
|
|
|
|
|
|
|
if(inf_or_nan) { |
2024
|
|
|
|
|
|
|
if(inf_or_nan == 2) { |
2025
|
|
|
|
|
|
|
if(SWITCH_ARGS) |
2026
|
|
|
|
|
|
|
*f = powq(_get_nan(), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
2027
|
|
|
|
|
|
|
else *f = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), _get_nan()); |
2028
|
|
|
|
|
|
|
} |
2029
|
|
|
|
|
|
|
else { |
2030
|
|
|
|
|
|
|
if(SWITCH_ARGS) |
2031
|
|
|
|
|
|
|
*f = powq(_get_inf(inf_or_nan), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
2032
|
|
|
|
|
|
|
else *f = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), _get_inf(inf_or_nan)); |
2033
|
|
|
|
|
|
|
} |
2034
|
|
|
|
|
|
|
} |
2035
|
|
|
|
|
|
|
else { |
2036
|
|
|
|
|
|
|
if(SWITCH_ARGS) |
2037
|
|
|
|
|
|
|
*f = powq(strtoflt128(SvPV_nolen(b), &p), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
2038
|
|
|
|
|
|
|
else *f = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), strtoflt128(SvPV_nolen(b), &p)); |
2039
|
|
|
|
|
|
|
_nnum_inc(p); |
2040
|
|
|
|
|
|
|
} |
2041
|
|
|
|
|
|
|
#else |
2042
|
4
|
50
|
|
|
|
|
if(SWITCH_ARGS) |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
2043
|
3
|
50
|
|
|
|
|
*f = powq(strtoflt128(SvPV_nolen(b), &p), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
2044
|
1
|
50
|
|
|
|
|
else *f = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), strtoflt128(SvPV_nolen(b), &p)); |
2045
|
4
|
|
|
|
|
|
_nnum_inc(p); |
2046
|
|
|
|
|
|
|
#endif |
2047
|
4
|
|
|
|
|
|
return obj_ref; |
2048
|
|
|
|
|
|
|
} |
2049
|
|
|
|
|
|
|
|
2050
|
5
|
100
|
|
|
|
|
if(SvNOK(b)) { |
2051
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
2052
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
2053
|
|
|
|
|
|
|
if(SWITCH_ARGS) |
2054
|
|
|
|
|
|
|
*f = powq(_get_inf(SvNVX(b) > 0 ? 1 : -1), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
2055
|
|
|
|
|
|
|
else *f = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), _get_inf(SvNVX(b) > 0 ? 1 : -1)); |
2056
|
|
|
|
|
|
|
return obj_ref; |
2057
|
|
|
|
|
|
|
} |
2058
|
|
|
|
|
|
|
#endif |
2059
|
3
|
50
|
|
|
|
|
if(SWITCH_ARGS) |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
2060
|
2
|
|
|
|
|
|
*f = powq((float128)SvNVX(b), *(INT2PTR(float128 *, SvIVX(SvRV(a))))); |
2061
|
1
|
|
|
|
|
|
else *f = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), (float128)SvNVX(b)); |
2062
|
3
|
|
|
|
|
|
return obj_ref; |
2063
|
|
|
|
|
|
|
} |
2064
|
|
|
|
|
|
|
|
2065
|
2
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
2066
|
2
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
2067
|
2
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
2068
|
2
|
|
|
|
|
|
*f = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), *(INT2PTR(float128 *, SvIVX(SvRV(b))))); |
2069
|
2
|
|
|
|
|
|
return obj_ref; |
2070
|
|
|
|
|
|
|
} |
2071
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_pow function"); |
2072
|
|
|
|
|
|
|
} |
2073
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_pow function"); |
2074
|
|
|
|
|
|
|
} |
2075
|
|
|
|
|
|
|
|
2076
|
5
|
|
|
|
|
|
SV * _overload_pow_eq(pTHX_ SV * a, SV * b, SV * third) { |
2077
|
|
|
|
|
|
|
|
2078
|
5
|
|
|
|
|
|
SvREFCNT_inc(a); |
2079
|
|
|
|
|
|
|
|
2080
|
5
|
50
|
|
|
|
|
if(SvUOK(b)) { |
2081
|
0
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), |
2082
|
0
|
|
|
|
|
|
(float128)SvUVX(b)); |
2083
|
0
|
|
|
|
|
|
return a; |
2084
|
|
|
|
|
|
|
} |
2085
|
|
|
|
|
|
|
|
2086
|
5
|
100
|
|
|
|
|
if(SvIOK(b)) { |
2087
|
1
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), |
2088
|
1
|
|
|
|
|
|
(float128)SvIVX(b)); |
2089
|
1
|
|
|
|
|
|
return a; |
2090
|
|
|
|
|
|
|
} |
2091
|
|
|
|
|
|
|
|
2092
|
4
|
100
|
|
|
|
|
if(SvPOK(b)) { |
2093
|
|
|
|
|
|
|
char * p; |
2094
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
2095
|
|
|
|
|
|
|
int inf_or_nan = _win32_infnanstring(SvPV_nolen(b)); |
2096
|
|
|
|
|
|
|
#endif |
2097
|
|
|
|
|
|
|
|
2098
|
1
|
50
|
|
|
|
|
NOK_POK_DUALVAR_CHECK , "overload_pow_eq");} |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2099
|
|
|
|
|
|
|
|
2100
|
|
|
|
|
|
|
#ifdef _WIN32_BIZARRE_INFNAN |
2101
|
|
|
|
|
|
|
|
2102
|
|
|
|
|
|
|
if(inf_or_nan) { |
2103
|
|
|
|
|
|
|
if(inf_or_nan == 2) { |
2104
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), |
2105
|
|
|
|
|
|
|
_get_nan()); |
2106
|
|
|
|
|
|
|
return a; |
2107
|
|
|
|
|
|
|
} |
2108
|
|
|
|
|
|
|
|
2109
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), |
2110
|
|
|
|
|
|
|
_get_inf(inf_or_nan)); |
2111
|
|
|
|
|
|
|
return a; |
2112
|
|
|
|
|
|
|
} |
2113
|
|
|
|
|
|
|
|
2114
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), |
2115
|
|
|
|
|
|
|
strtoflt128(SvPV_nolen(b), &p)); |
2116
|
|
|
|
|
|
|
_nnum_inc(p); |
2117
|
|
|
|
|
|
|
return a; |
2118
|
|
|
|
|
|
|
#else |
2119
|
1
|
50
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), |
2120
|
1
|
|
|
|
|
|
strtoflt128(SvPV_nolen(b), &p)); |
2121
|
1
|
|
|
|
|
|
_nnum_inc(p); |
2122
|
1
|
|
|
|
|
|
return a; |
2123
|
|
|
|
|
|
|
#endif |
2124
|
|
|
|
|
|
|
} |
2125
|
|
|
|
|
|
|
|
2126
|
3
|
100
|
|
|
|
|
if(SvNOK(b)) { |
2127
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
2128
|
|
|
|
|
|
|
if(SvNVX(b) != 0.0L && SvNVX(b) == SvNVX(b) && SvNVX(b) / SvNVX(b) != SvNVX(b) / SvNVX(b)) { |
2129
|
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), |
2130
|
|
|
|
|
|
|
_get_inf(SvNVX(b) > 0 ? 1 : -1)); |
2131
|
|
|
|
|
|
|
return a; |
2132
|
|
|
|
|
|
|
} |
2133
|
|
|
|
|
|
|
#endif |
2134
|
1
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), |
2135
|
1
|
|
|
|
|
|
(float128)SvNVX(b)); |
2136
|
1
|
|
|
|
|
|
return a; |
2137
|
|
|
|
|
|
|
} |
2138
|
|
|
|
|
|
|
|
2139
|
2
|
50
|
|
|
|
|
if(sv_isobject(b)) { |
2140
|
2
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(b))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
2141
|
2
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
2142
|
2
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(a)))) = powq(*(INT2PTR(float128 *, SvIVX(SvRV(a)))), |
2143
|
2
|
|
|
|
|
|
*(INT2PTR(float128 *, SvIVX(SvRV(b))))); |
2144
|
2
|
|
|
|
|
|
return a; |
2145
|
|
|
|
|
|
|
} |
2146
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
2147
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::_overload_pow_eq function"); |
2148
|
|
|
|
|
|
|
} |
2149
|
0
|
|
|
|
|
|
SvREFCNT_dec(a); |
2150
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::_overload_pow_eq function"); |
2151
|
|
|
|
|
|
|
} |
2152
|
|
|
|
|
|
|
|
2153
|
71
|
|
|
|
|
|
SV * cmp2NV(pTHX_ SV * flt128_obj, SV * sv) { |
2154
|
|
|
|
|
|
|
float128 f; |
2155
|
|
|
|
|
|
|
NV nv; |
2156
|
|
|
|
|
|
|
|
2157
|
71
|
50
|
|
|
|
|
if(sv_isobject(flt128_obj)) { |
2158
|
71
|
50
|
|
|
|
|
const char *h = HvNAME(SvSTASH(SvRV(flt128_obj))); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
2159
|
71
|
50
|
|
|
|
|
if(strEQ(h, "Math::Float128")) { |
2160
|
71
|
|
|
|
|
|
f = *(INT2PTR(float128 *, SvIVX(SvRV(flt128_obj)))); |
2161
|
71
|
100
|
|
|
|
|
nv = SvNV(sv); |
2162
|
|
|
|
|
|
|
|
2163
|
71
|
50
|
|
|
|
|
if((f != f) || (nv != nv)) return &PL_sv_undef; |
|
|
50
|
|
|
|
|
|
2164
|
71
|
100
|
|
|
|
|
if(f < (float128)nv) return newSViv(-1); |
2165
|
46
|
100
|
|
|
|
|
if(f > (float128)nv) return newSViv(1); |
2166
|
22
|
|
|
|
|
|
return newSViv(0); |
2167
|
|
|
|
|
|
|
} |
2168
|
0
|
|
|
|
|
|
croak("Invalid object supplied to Math::Float128::cmp2NV function"); |
2169
|
|
|
|
|
|
|
} |
2170
|
0
|
|
|
|
|
|
croak("Invalid argument supplied to Math::Float128::cmp_NV function"); |
2171
|
|
|
|
|
|
|
} |
2172
|
|
|
|
|
|
|
|
2173
|
52
|
|
|
|
|
|
SV * F128toNV(pTHX_ SV * f) { |
2174
|
52
|
|
|
|
|
|
return newSVnv((NV)(*(INT2PTR(float128 *, SvIVX(SvRV(f)))))); |
2175
|
|
|
|
|
|
|
} |
2176
|
|
|
|
|
|
|
|
2177
|
|
|
|
|
|
|
/* #define FLT128_MAX 1.18973149535723176508575932662800702e4932Q */ |
2178
|
|
|
|
|
|
|
|
2179
|
1
|
|
|
|
|
|
SV * _FLT128_MAX(pTHX) { |
2180
|
|
|
|
|
|
|
#ifdef FLT128_MAX |
2181
|
|
|
|
|
|
|
float128 * f; |
2182
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2183
|
|
|
|
|
|
|
|
2184
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2185
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _FLT128_MAX function"); |
2186
|
|
|
|
|
|
|
|
2187
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2188
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2189
|
|
|
|
|
|
|
|
2190
|
1
|
|
|
|
|
|
*f = FLT128_MAX; |
2191
|
|
|
|
|
|
|
|
2192
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2193
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2194
|
1
|
|
|
|
|
|
return obj_ref; |
2195
|
|
|
|
|
|
|
#else |
2196
|
|
|
|
|
|
|
croak("FLT128_MAX not implemented"); |
2197
|
|
|
|
|
|
|
#endif |
2198
|
|
|
|
|
|
|
} |
2199
|
|
|
|
|
|
|
|
2200
|
|
|
|
|
|
|
/* #define FLT128_MIN 3.36210314311209350626267781732175260e-4932Q */ |
2201
|
|
|
|
|
|
|
|
2202
|
1
|
|
|
|
|
|
SV * _FLT128_MIN(pTHX) { |
2203
|
|
|
|
|
|
|
#ifdef FLT128_MIN |
2204
|
|
|
|
|
|
|
float128 * f; |
2205
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2206
|
|
|
|
|
|
|
|
2207
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2208
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _FLT128_MIN function"); |
2209
|
|
|
|
|
|
|
|
2210
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2211
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2212
|
|
|
|
|
|
|
|
2213
|
1
|
|
|
|
|
|
*f = FLT128_MIN; |
2214
|
|
|
|
|
|
|
|
2215
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2216
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2217
|
1
|
|
|
|
|
|
return obj_ref; |
2218
|
|
|
|
|
|
|
#else |
2219
|
|
|
|
|
|
|
croak("FLT128_MIN not implemented"); |
2220
|
|
|
|
|
|
|
#endif |
2221
|
|
|
|
|
|
|
} |
2222
|
|
|
|
|
|
|
|
2223
|
|
|
|
|
|
|
/* #define FLT128_EPSILON 1.92592994438723585305597794258492732e-34Q */ |
2224
|
|
|
|
|
|
|
|
2225
|
1
|
|
|
|
|
|
SV * _FLT128_EPSILON(pTHX) { |
2226
|
|
|
|
|
|
|
#ifdef FLT128_EPSILON |
2227
|
|
|
|
|
|
|
float128 * f; |
2228
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2229
|
|
|
|
|
|
|
|
2230
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2231
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _FLT128_EPSILON function"); |
2232
|
|
|
|
|
|
|
|
2233
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2234
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2235
|
|
|
|
|
|
|
|
2236
|
1
|
|
|
|
|
|
*f = FLT128_EPSILON; |
2237
|
|
|
|
|
|
|
|
2238
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2239
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2240
|
1
|
|
|
|
|
|
return obj_ref; |
2241
|
|
|
|
|
|
|
#else |
2242
|
|
|
|
|
|
|
croak("FLT128_EPSILON not implemented"); |
2243
|
|
|
|
|
|
|
#endif |
2244
|
|
|
|
|
|
|
} |
2245
|
|
|
|
|
|
|
|
2246
|
|
|
|
|
|
|
/* #define FLT128_DENORM_MIN 6.475175119438025110924438958227646552e-4966Q */ |
2247
|
|
|
|
|
|
|
|
2248
|
|
|
|
|
|
|
|
2249
|
1
|
|
|
|
|
|
SV * _FLT128_DENORM_MIN(pTHX) { |
2250
|
|
|
|
|
|
|
#ifdef FLT128_DENORM_MIN |
2251
|
|
|
|
|
|
|
float128 * f; |
2252
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2253
|
|
|
|
|
|
|
|
2254
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2255
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _FLT128_DENORM_MIN function"); |
2256
|
|
|
|
|
|
|
|
2257
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2258
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2259
|
|
|
|
|
|
|
|
2260
|
1
|
|
|
|
|
|
*f = FLT128_DENORM_MIN; |
2261
|
|
|
|
|
|
|
|
2262
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2263
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2264
|
1
|
|
|
|
|
|
return obj_ref; |
2265
|
|
|
|
|
|
|
#else |
2266
|
|
|
|
|
|
|
croak("FLT128_DENORM_MIN not implemented"); |
2267
|
|
|
|
|
|
|
#endif |
2268
|
|
|
|
|
|
|
} |
2269
|
|
|
|
|
|
|
|
2270
|
|
|
|
|
|
|
/* #define FLT128_MANT_DIG 113 */ |
2271
|
|
|
|
|
|
|
|
2272
|
1
|
|
|
|
|
|
int _FLT128_MANT_DIG(void) { |
2273
|
|
|
|
|
|
|
#ifdef FLT128_MANT_DIG |
2274
|
1
|
|
|
|
|
|
return (int)FLT128_MANT_DIG; |
2275
|
|
|
|
|
|
|
#else |
2276
|
|
|
|
|
|
|
croak("FLT128_MANT_DIG not implemented"); |
2277
|
|
|
|
|
|
|
#endif |
2278
|
|
|
|
|
|
|
} |
2279
|
|
|
|
|
|
|
|
2280
|
|
|
|
|
|
|
/* #define FLT128_MIN_EXP (-16381) */ |
2281
|
|
|
|
|
|
|
|
2282
|
1
|
|
|
|
|
|
int _FLT128_MIN_EXP(void) { |
2283
|
|
|
|
|
|
|
#ifdef FLT128_MIN_EXP |
2284
|
1
|
|
|
|
|
|
return (int)FLT128_MIN_EXP; |
2285
|
|
|
|
|
|
|
#else |
2286
|
|
|
|
|
|
|
croak("FLT128_MIN_EXP not implemented"); |
2287
|
|
|
|
|
|
|
#endif |
2288
|
|
|
|
|
|
|
} |
2289
|
|
|
|
|
|
|
|
2290
|
|
|
|
|
|
|
/* #define FLT128_MAX_EXP 16384 */ |
2291
|
|
|
|
|
|
|
|
2292
|
1
|
|
|
|
|
|
int _FLT128_MAX_EXP(void) { |
2293
|
|
|
|
|
|
|
#ifdef FLT128_MAX_EXP |
2294
|
1
|
|
|
|
|
|
return (int)FLT128_MAX_EXP; |
2295
|
|
|
|
|
|
|
#else |
2296
|
|
|
|
|
|
|
croak("FLT128_MAX_EXP not implemented"); |
2297
|
|
|
|
|
|
|
#endif |
2298
|
|
|
|
|
|
|
} |
2299
|
|
|
|
|
|
|
|
2300
|
|
|
|
|
|
|
/* #define FLT128_MIN_10_EXP (-4931) */ |
2301
|
|
|
|
|
|
|
|
2302
|
1
|
|
|
|
|
|
int _FLT128_MIN_10_EXP(void) { |
2303
|
|
|
|
|
|
|
#ifdef FLT128_MIN_10_EXP |
2304
|
1
|
|
|
|
|
|
return (int)FLT128_MIN_10_EXP; |
2305
|
|
|
|
|
|
|
#else |
2306
|
|
|
|
|
|
|
croak("FLT128_MIN_10_EXP not implemented"); |
2307
|
|
|
|
|
|
|
#endif |
2308
|
|
|
|
|
|
|
} |
2309
|
|
|
|
|
|
|
|
2310
|
|
|
|
|
|
|
/* #define FLT128_MAX_10_EXP 4932 */ |
2311
|
|
|
|
|
|
|
|
2312
|
1
|
|
|
|
|
|
int _FLT128_MAX_10_EXP(void) { |
2313
|
|
|
|
|
|
|
#ifdef FLT128_MAX_10_EXP |
2314
|
1
|
|
|
|
|
|
return (int)FLT128_MAX_10_EXP; |
2315
|
|
|
|
|
|
|
#else |
2316
|
|
|
|
|
|
|
croak("FLT128_MAX_10_EXP not implemented"); |
2317
|
|
|
|
|
|
|
#endif |
2318
|
|
|
|
|
|
|
} |
2319
|
|
|
|
|
|
|
|
2320
|
|
|
|
|
|
|
/* #define HUGE_VALQ __builtin_huge_valq() */ |
2321
|
|
|
|
|
|
|
|
2322
|
|
|
|
|
|
|
|
2323
|
|
|
|
|
|
|
/*#define M_Eq 2.7182818284590452353602874713526625Q */ /* e */ |
2324
|
|
|
|
|
|
|
|
2325
|
1
|
|
|
|
|
|
SV * _M_Eq(pTHX) { |
2326
|
|
|
|
|
|
|
#ifndef M_Eq |
2327
|
|
|
|
|
|
|
#define M_Eq expq(1.0Q) |
2328
|
|
|
|
|
|
|
#endif |
2329
|
|
|
|
|
|
|
float128 * f; |
2330
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2331
|
|
|
|
|
|
|
|
2332
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2333
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _M_Eq function"); |
2334
|
|
|
|
|
|
|
|
2335
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2336
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2337
|
|
|
|
|
|
|
|
2338
|
1
|
|
|
|
|
|
*f = M_Eq; |
2339
|
|
|
|
|
|
|
|
2340
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2341
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2342
|
1
|
|
|
|
|
|
return obj_ref; |
2343
|
|
|
|
|
|
|
} |
2344
|
|
|
|
|
|
|
|
2345
|
|
|
|
|
|
|
/* #define M_LOG2Eq 1.4426950408889634073599246810018921Q */ /* log_2 e */ |
2346
|
|
|
|
|
|
|
|
2347
|
1
|
|
|
|
|
|
SV * _M_LOG2Eq(pTHX) { |
2348
|
|
|
|
|
|
|
#ifndef M_LOG2Eq |
2349
|
|
|
|
|
|
|
#define M_LOG2Eq log2q(expq(1.0Q)) |
2350
|
|
|
|
|
|
|
#endif |
2351
|
|
|
|
|
|
|
float128 * f; |
2352
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2353
|
|
|
|
|
|
|
|
2354
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2355
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _M_LOG2Eq function"); |
2356
|
|
|
|
|
|
|
|
2357
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2358
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2359
|
|
|
|
|
|
|
|
2360
|
1
|
|
|
|
|
|
*f = M_LOG2Eq; |
2361
|
|
|
|
|
|
|
|
2362
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2363
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2364
|
1
|
|
|
|
|
|
return obj_ref; |
2365
|
|
|
|
|
|
|
} |
2366
|
|
|
|
|
|
|
|
2367
|
|
|
|
|
|
|
/* #define M_LOG10Eq 0.4342944819032518276511289189166051Q */ /* log_10 e */ |
2368
|
|
|
|
|
|
|
|
2369
|
1
|
|
|
|
|
|
SV * _M_LOG10Eq(pTHX) { |
2370
|
|
|
|
|
|
|
#ifndef M_LOG10Eq |
2371
|
|
|
|
|
|
|
#define M_LOG10Eq lo10q(expq(1.0Q)) |
2372
|
|
|
|
|
|
|
#endif |
2373
|
|
|
|
|
|
|
float128 * f; |
2374
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2375
|
|
|
|
|
|
|
|
2376
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2377
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _M_LOG10Eq function"); |
2378
|
|
|
|
|
|
|
|
2379
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2380
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2381
|
|
|
|
|
|
|
|
2382
|
1
|
|
|
|
|
|
*f = M_LOG10Eq; |
2383
|
|
|
|
|
|
|
|
2384
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2385
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2386
|
1
|
|
|
|
|
|
return obj_ref; |
2387
|
|
|
|
|
|
|
} |
2388
|
|
|
|
|
|
|
|
2389
|
|
|
|
|
|
|
/* #define M_LN2q 0.6931471805599453094172321214581766Q */ /* log_e 2 */ |
2390
|
|
|
|
|
|
|
|
2391
|
1
|
|
|
|
|
|
SV * _M_LN2q(pTHX) { |
2392
|
|
|
|
|
|
|
#ifndef M_LN2q |
2393
|
|
|
|
|
|
|
#define M_LN2q logq(2.0Q) |
2394
|
|
|
|
|
|
|
#endif |
2395
|
|
|
|
|
|
|
float128 * f; |
2396
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2397
|
|
|
|
|
|
|
|
2398
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2399
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _M_LN2q function"); |
2400
|
|
|
|
|
|
|
|
2401
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2402
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2403
|
|
|
|
|
|
|
|
2404
|
1
|
|
|
|
|
|
*f = M_LN2q; |
2405
|
|
|
|
|
|
|
|
2406
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2407
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2408
|
1
|
|
|
|
|
|
return obj_ref; |
2409
|
|
|
|
|
|
|
} |
2410
|
|
|
|
|
|
|
|
2411
|
|
|
|
|
|
|
/* #define M_LN10q 2.3025850929940456840179914546843642Q */ /* log_e 10 */ |
2412
|
|
|
|
|
|
|
|
2413
|
1
|
|
|
|
|
|
SV * _M_LN10q(pTHX) { |
2414
|
|
|
|
|
|
|
#ifndef M_LN10q |
2415
|
|
|
|
|
|
|
#define M_LN10q logq(10.0Q) |
2416
|
|
|
|
|
|
|
#endif |
2417
|
|
|
|
|
|
|
float128 * f; |
2418
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2419
|
|
|
|
|
|
|
|
2420
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2421
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _M_LN10q function"); |
2422
|
|
|
|
|
|
|
|
2423
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2424
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2425
|
|
|
|
|
|
|
|
2426
|
1
|
|
|
|
|
|
*f = M_LN10q; |
2427
|
|
|
|
|
|
|
|
2428
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2429
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2430
|
1
|
|
|
|
|
|
return obj_ref; |
2431
|
|
|
|
|
|
|
} |
2432
|
|
|
|
|
|
|
|
2433
|
|
|
|
|
|
|
/* #define M_PIq 3.1415926535897932384626433832795029Q */ /* pi */ |
2434
|
|
|
|
|
|
|
|
2435
|
1
|
|
|
|
|
|
SV * _M_PIq(pTHX) { |
2436
|
|
|
|
|
|
|
#ifndef M_PIq |
2437
|
|
|
|
|
|
|
#define M_PIq 2.0Q*asinq(1.0Q) |
2438
|
|
|
|
|
|
|
#endif |
2439
|
|
|
|
|
|
|
float128 * f; |
2440
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2441
|
|
|
|
|
|
|
|
2442
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2443
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _M_PIq function"); |
2444
|
|
|
|
|
|
|
|
2445
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2446
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2447
|
|
|
|
|
|
|
|
2448
|
1
|
|
|
|
|
|
*f = M_PIq; |
2449
|
|
|
|
|
|
|
|
2450
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2451
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2452
|
1
|
|
|
|
|
|
return obj_ref; |
2453
|
|
|
|
|
|
|
} |
2454
|
|
|
|
|
|
|
|
2455
|
|
|
|
|
|
|
/* #define M_PI_2q 1.5707963267948966192313216916397514Q */ /* pi/2 */ |
2456
|
|
|
|
|
|
|
|
2457
|
1
|
|
|
|
|
|
SV * _M_PI_2q(pTHX) { |
2458
|
|
|
|
|
|
|
#ifndef M_PI_2q |
2459
|
|
|
|
|
|
|
#define M_PI_2q asinq(1.0Q) |
2460
|
|
|
|
|
|
|
#endif |
2461
|
|
|
|
|
|
|
float128 * f; |
2462
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2463
|
|
|
|
|
|
|
|
2464
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2465
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _M_PI_2q function"); |
2466
|
|
|
|
|
|
|
|
2467
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2468
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2469
|
|
|
|
|
|
|
|
2470
|
1
|
|
|
|
|
|
*f = M_PI_2q; |
2471
|
|
|
|
|
|
|
|
2472
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2473
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2474
|
1
|
|
|
|
|
|
return obj_ref; |
2475
|
|
|
|
|
|
|
} |
2476
|
|
|
|
|
|
|
|
2477
|
|
|
|
|
|
|
/* #define M_PI_4q 0.7853981633974483096156608458198757Q */ /* pi/4 */ |
2478
|
|
|
|
|
|
|
|
2479
|
1
|
|
|
|
|
|
SV * _M_PI_4q(pTHX) { |
2480
|
|
|
|
|
|
|
#ifndef M_PI_4q |
2481
|
|
|
|
|
|
|
#define M_PI_4q asinq(1.0Q)/2.0Q |
2482
|
|
|
|
|
|
|
#endif |
2483
|
|
|
|
|
|
|
float128 * f; |
2484
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2485
|
|
|
|
|
|
|
|
2486
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2487
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _M_PI_4q function"); |
2488
|
|
|
|
|
|
|
|
2489
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2490
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2491
|
|
|
|
|
|
|
|
2492
|
1
|
|
|
|
|
|
*f = M_PI_4q; |
2493
|
|
|
|
|
|
|
|
2494
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2495
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2496
|
1
|
|
|
|
|
|
return obj_ref; |
2497
|
|
|
|
|
|
|
} |
2498
|
|
|
|
|
|
|
|
2499
|
|
|
|
|
|
|
/* #define M_1_PIq 0.3183098861837906715377675267450287Q */ /* 1/pi */ |
2500
|
|
|
|
|
|
|
|
2501
|
1
|
|
|
|
|
|
SV * _M_1_PIq(pTHX) { |
2502
|
|
|
|
|
|
|
#ifndef M_1_PIq |
2503
|
|
|
|
|
|
|
#define M_1_PIq 0.5Q/asinq(1.0Q) |
2504
|
|
|
|
|
|
|
#endif |
2505
|
|
|
|
|
|
|
float128 * f; |
2506
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2507
|
|
|
|
|
|
|
|
2508
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2509
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _M_1_PIq function"); |
2510
|
|
|
|
|
|
|
|
2511
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2512
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2513
|
|
|
|
|
|
|
|
2514
|
1
|
|
|
|
|
|
*f = M_1_PIq; |
2515
|
|
|
|
|
|
|
|
2516
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2517
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2518
|
1
|
|
|
|
|
|
return obj_ref; |
2519
|
|
|
|
|
|
|
} |
2520
|
|
|
|
|
|
|
|
2521
|
|
|
|
|
|
|
/* #define M_2_PIq 0.6366197723675813430755350534900574Q */ /* 2/pi */ |
2522
|
|
|
|
|
|
|
|
2523
|
1
|
|
|
|
|
|
SV * _M_2_PIq(pTHX) { |
2524
|
|
|
|
|
|
|
#ifndef M_2_PIq |
2525
|
|
|
|
|
|
|
#define M_2_PIq 1.0Q/asinq(1.0Q) |
2526
|
|
|
|
|
|
|
#endif |
2527
|
|
|
|
|
|
|
float128 * f; |
2528
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2529
|
|
|
|
|
|
|
|
2530
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2531
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _M_2_PIq function"); |
2532
|
|
|
|
|
|
|
|
2533
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2534
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2535
|
|
|
|
|
|
|
|
2536
|
1
|
|
|
|
|
|
*f = M_2_PIq; |
2537
|
|
|
|
|
|
|
|
2538
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2539
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2540
|
1
|
|
|
|
|
|
return obj_ref; |
2541
|
|
|
|
|
|
|
} |
2542
|
|
|
|
|
|
|
|
2543
|
|
|
|
|
|
|
/* #define M_2_SQRTPIq 1.1283791670955125738961589031215452Q */ /* 2/sqrt(pi) */ |
2544
|
|
|
|
|
|
|
|
2545
|
1
|
|
|
|
|
|
SV * _M_2_SQRTPIq(pTHX) { |
2546
|
|
|
|
|
|
|
#ifndef M_2_SQRTPIq |
2547
|
|
|
|
|
|
|
#define M_2_SQRTPIq 2.0Q/sqrtq(2.0Q*asinq(1.0Q)) |
2548
|
|
|
|
|
|
|
#endif |
2549
|
|
|
|
|
|
|
float128 * f; |
2550
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2551
|
|
|
|
|
|
|
|
2552
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2553
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _M_2_SQRTPIq function"); |
2554
|
|
|
|
|
|
|
|
2555
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2556
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2557
|
|
|
|
|
|
|
|
2558
|
1
|
|
|
|
|
|
*f = M_2_SQRTPIq; |
2559
|
|
|
|
|
|
|
|
2560
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2561
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2562
|
1
|
|
|
|
|
|
return obj_ref; |
2563
|
|
|
|
|
|
|
} |
2564
|
|
|
|
|
|
|
|
2565
|
|
|
|
|
|
|
/* #define M_SQRT2q 1.4142135623730950488016887242096981Q */ /* sqrt(2) */ |
2566
|
|
|
|
|
|
|
|
2567
|
1
|
|
|
|
|
|
SV * _M_SQRT2q(pTHX) { |
2568
|
|
|
|
|
|
|
#ifndef M_SQRT2q |
2569
|
|
|
|
|
|
|
#define M_SQRT2q sqrtq(2.0Q) |
2570
|
|
|
|
|
|
|
#endif |
2571
|
|
|
|
|
|
|
float128 * f; |
2572
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2573
|
|
|
|
|
|
|
|
2574
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2575
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _M_SQRT2q function"); |
2576
|
|
|
|
|
|
|
|
2577
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2578
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2579
|
|
|
|
|
|
|
|
2580
|
1
|
|
|
|
|
|
*f = M_SQRT2q; |
2581
|
|
|
|
|
|
|
|
2582
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2583
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2584
|
1
|
|
|
|
|
|
return obj_ref; |
2585
|
|
|
|
|
|
|
} |
2586
|
|
|
|
|
|
|
|
2587
|
|
|
|
|
|
|
/* #define M_SQRT1_2q 0.7071067811865475244008443621048490Q */ /* 1/sqrt(2) */ |
2588
|
|
|
|
|
|
|
|
2589
|
1
|
|
|
|
|
|
SV * _M_SQRT1_2q(pTHX) { |
2590
|
|
|
|
|
|
|
#ifndef M_SQRT1_2q |
2591
|
|
|
|
|
|
|
#define M_SQRT1_2q 1.0Q/sqrtq(2.0Q) |
2592
|
|
|
|
|
|
|
#endif |
2593
|
|
|
|
|
|
|
float128 * f; |
2594
|
|
|
|
|
|
|
SV * obj_ref, * obj; |
2595
|
|
|
|
|
|
|
|
2596
|
1
|
|
|
|
|
|
Newx(f, 1, float128); |
2597
|
1
|
50
|
|
|
|
|
if(f == NULL) croak("Failed to allocate memory in _M_SQRT1_2q function"); |
2598
|
|
|
|
|
|
|
|
2599
|
1
|
|
|
|
|
|
obj_ref = newSV(0); |
2600
|
1
|
|
|
|
|
|
obj = newSVrv(obj_ref, "Math::Float128"); |
2601
|
|
|
|
|
|
|
|
2602
|
1
|
|
|
|
|
|
*f = M_SQRT1_2q; |
2603
|
|
|
|
|
|
|
|
2604
|
1
|
|
|
|
|
|
sv_setiv(obj, INT2PTR(IV,f)); |
2605
|
1
|
|
|
|
|
|
SvREADONLY_on(obj); |
2606
|
1
|
|
|
|
|
|
return obj_ref; |
2607
|
|
|
|
|
|
|
} |
2608
|
|
|
|
|
|
|
|
2609
|
1
|
|
|
|
|
|
void _f128_bytes(pTHX_ SV * sv) { |
2610
|
1
|
|
|
|
|
|
dXSARGS; |
2611
|
1
|
|
|
|
|
|
float128 f128 = *(INT2PTR(float128 *, SvIVX(SvRV(sv)))); |
2612
|
1
|
|
|
|
|
|
int i, n = sizeof(float128); |
2613
|
|
|
|
|
|
|
char * buff; |
2614
|
1
|
|
|
|
|
|
void * p = &f128; |
2615
|
|
|
|
|
|
|
|
2616
|
1
|
|
|
|
|
|
Newx(buff, 4, char); |
2617
|
1
|
50
|
|
|
|
|
if(buff == NULL) croak("Failed to allocate memory in _f128_bytes function"); |
2618
|
|
|
|
|
|
|
|
2619
|
1
|
|
|
|
|
|
sp = mark; |
2620
|
|
|
|
|
|
|
|
2621
|
|
|
|
|
|
|
#ifdef WE_HAVE_BENDIAN /* Big Endian architecture */ |
2622
|
|
|
|
|
|
|
for (i = 0; i < n; i++) { |
2623
|
|
|
|
|
|
|
#else |
2624
|
17
|
100
|
|
|
|
|
for (i = n - 1; i >= 0; i--) { |
2625
|
|
|
|
|
|
|
#endif |
2626
|
|
|
|
|
|
|
|
2627
|
16
|
|
|
|
|
|
sprintf(buff, "%02X", ((unsigned char*)p)[i]); |
2628
|
16
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVpv(buff, 0))); |
2629
|
|
|
|
|
|
|
} |
2630
|
1
|
|
|
|
|
|
PUTBACK; |
2631
|
1
|
|
|
|
|
|
Safefree(buff); |
2632
|
1
|
|
|
|
|
|
XSRETURN(n); |
2633
|
|
|
|
|
|
|
} |
2634
|
|
|
|
|
|
|
|
2635
|
1
|
|
|
|
|
|
void acos_F128(float128 * rop, float128 * op) { |
2636
|
1
|
|
|
|
|
|
*rop = acosq(*op); |
2637
|
1
|
|
|
|
|
|
} |
2638
|
|
|
|
|
|
|
|
2639
|
1
|
|
|
|
|
|
void acosh_F128(float128 * rop, float128 * op) { |
2640
|
1
|
|
|
|
|
|
*rop = acoshq(*op); |
2641
|
1
|
|
|
|
|
|
} |
2642
|
|
|
|
|
|
|
|
2643
|
1
|
|
|
|
|
|
void asin_F128(float128 * rop, float128 * op) { |
2644
|
1
|
|
|
|
|
|
*rop = asinq(*op); |
2645
|
1
|
|
|
|
|
|
} |
2646
|
|
|
|
|
|
|
|
2647
|
1
|
|
|
|
|
|
void asinh_F128(float128 * rop, float128 * op) { |
2648
|
1
|
|
|
|
|
|
*rop = asinhq(*op); |
2649
|
1
|
|
|
|
|
|
} |
2650
|
|
|
|
|
|
|
|
2651
|
1
|
|
|
|
|
|
void atan_F128(float128 * rop, float128 * op) { |
2652
|
1
|
|
|
|
|
|
*rop = atanq(*op); |
2653
|
1
|
|
|
|
|
|
} |
2654
|
|
|
|
|
|
|
|
2655
|
1
|
|
|
|
|
|
void atanh_F128(float128 * rop, float128 * op) { |
2656
|
1
|
|
|
|
|
|
*rop = atanhq(*op); |
2657
|
1
|
|
|
|
|
|
} |
2658
|
|
|
|
|
|
|
|
2659
|
1
|
|
|
|
|
|
void atan2_F128(float128 * rop, float128 * op1, float128 * op2) { |
2660
|
1
|
|
|
|
|
|
*rop = atan2q(*op1, *op2); |
2661
|
1
|
|
|
|
|
|
} |
2662
|
|
|
|
|
|
|
|
2663
|
1
|
|
|
|
|
|
void cbrt_F128(float128 * rop, float128 * op) { |
2664
|
1
|
|
|
|
|
|
*rop = cbrtq(*op); |
2665
|
1
|
|
|
|
|
|
} |
2666
|
|
|
|
|
|
|
|
2667
|
2
|
|
|
|
|
|
void ceil_F128(float128 * rop, float128 * op) { |
2668
|
2
|
|
|
|
|
|
*rop = ceilq(*op); |
2669
|
2
|
|
|
|
|
|
} |
2670
|
|
|
|
|
|
|
|
2671
|
4
|
|
|
|
|
|
void copysign_F128(float128 * rop, float128 * op1, float128 * op2) { |
2672
|
4
|
|
|
|
|
|
*rop = copysignq(*op1, *op2); |
2673
|
4
|
|
|
|
|
|
} |
2674
|
|
|
|
|
|
|
|
2675
|
1
|
|
|
|
|
|
void cosh_F128(float128 * rop, float128 * op) { |
2676
|
|
|
|
|
|
|
#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 4 /* avoid calling coshq() as it's buggy */ |
2677
|
|
|
|
|
|
|
float128 temp = sinhq(*op); |
2678
|
|
|
|
|
|
|
temp = powq(temp, 2) + 1.0Q; |
2679
|
|
|
|
|
|
|
*rop = sqrtq(temp); |
2680
|
|
|
|
|
|
|
#else |
2681
|
1
|
|
|
|
|
|
*rop = coshq(*op); |
2682
|
|
|
|
|
|
|
#endif |
2683
|
1
|
|
|
|
|
|
} |
2684
|
|
|
|
|
|
|
|
2685
|
1
|
|
|
|
|
|
void cos_F128(float128 * rop, float128 * op) { |
2686
|
1
|
|
|
|
|
|
*rop = cosq(*op); |
2687
|
1
|
|
|
|
|
|
} |
2688
|
|
|
|
|
|
|
|
2689
|
1
|
|
|
|
|
|
void erf_F128(float128 * rop, float128 * op) { |
2690
|
1
|
|
|
|
|
|
*rop = erfq(*op); |
2691
|
1
|
|
|
|
|
|
} |
2692
|
|
|
|
|
|
|
|
2693
|
1
|
|
|
|
|
|
void erfc_F128(float128 * rop, float128 * op) { |
2694
|
1
|
|
|
|
|
|
*rop = erfcq(*op); |
2695
|
1
|
|
|
|
|
|
} |
2696
|
|
|
|
|
|
|
|
2697
|
1
|
|
|
|
|
|
void exp_F128(float128 * rop, float128 * op) { |
2698
|
|
|
|
|
|
|
#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 4 /* avoid calling expq() as it's buggy */ |
2699
|
|
|
|
|
|
|
*rop = powq(M_Eq, *op); |
2700
|
|
|
|
|
|
|
#else |
2701
|
1
|
|
|
|
|
|
*rop = expq(*op); |
2702
|
|
|
|
|
|
|
#endif |
2703
|
1
|
|
|
|
|
|
} |
2704
|
|
|
|
|
|
|
|
2705
|
1
|
|
|
|
|
|
void expm1_F128(float128 * rop, float128 * op) { |
2706
|
1
|
|
|
|
|
|
*rop = expm1q(*op); |
2707
|
1
|
|
|
|
|
|
} |
2708
|
|
|
|
|
|
|
|
2709
|
1
|
|
|
|
|
|
void fabs_F128(float128 * rop, float128 * op) { |
2710
|
1
|
|
|
|
|
|
*rop = fabsq(*op); |
2711
|
1
|
|
|
|
|
|
} |
2712
|
|
|
|
|
|
|
|
2713
|
2
|
|
|
|
|
|
void fdim_F128(float128 * rop, float128 * op1, float128 * op2) { |
2714
|
2
|
|
|
|
|
|
*rop = fdimq(*op1, *op2); |
2715
|
2
|
|
|
|
|
|
} |
2716
|
|
|
|
|
|
|
|
2717
|
7
|
|
|
|
|
|
int finite_F128(float128 * op) { |
2718
|
7
|
|
|
|
|
|
return finiteq(*op); |
2719
|
|
|
|
|
|
|
} |
2720
|
|
|
|
|
|
|
|
2721
|
2
|
|
|
|
|
|
void floor_F128(float128 * rop, float128 * op) { |
2722
|
2
|
|
|
|
|
|
*rop = floorq(*op); |
2723
|
2
|
|
|
|
|
|
} |
2724
|
|
|
|
|
|
|
|
2725
|
1
|
|
|
|
|
|
void fma_F128(float128 * rop, float128 * op1, float128 * op2, float128 * op3) { |
2726
|
|
|
|
|
|
|
#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 4 /* avoid calling fmaq() as it's buggy */ |
2727
|
|
|
|
|
|
|
float128 temp = *op1 * *op2; |
2728
|
|
|
|
|
|
|
temp += *op3; |
2729
|
|
|
|
|
|
|
*rop = temp; |
2730
|
|
|
|
|
|
|
#else |
2731
|
1
|
|
|
|
|
|
*rop = fmaq(*op1, *op2, *op3); |
2732
|
|
|
|
|
|
|
#endif |
2733
|
1
|
|
|
|
|
|
} |
2734
|
|
|
|
|
|
|
|
2735
|
1
|
|
|
|
|
|
void fmax_F128(float128 * rop, float128 * op1, float128 * op2) { |
2736
|
1
|
|
|
|
|
|
*rop = fmaxq(*op1, *op2); |
2737
|
1
|
|
|
|
|
|
} |
2738
|
|
|
|
|
|
|
|
2739
|
1
|
|
|
|
|
|
void fmin_F128(float128 * rop, float128 * op1, float128 * op2) { |
2740
|
1
|
|
|
|
|
|
*rop = fminq(*op1, *op2); |
2741
|
1
|
|
|
|
|
|
} |
2742
|
|
|
|
|
|
|
|
2743
|
1
|
|
|
|
|
|
void fmod_F128(float128 * rop, float128 * op1, float128 * op2) { |
2744
|
1
|
|
|
|
|
|
*rop = fmodq(*op1, *op2); |
2745
|
1
|
|
|
|
|
|
} |
2746
|
|
|
|
|
|
|
|
2747
|
1
|
|
|
|
|
|
void hypot_F128(float128 * rop, float128 * op1, float128 * op2) { |
2748
|
1
|
|
|
|
|
|
*rop = hypotq(*op1, *op2); |
2749
|
1
|
|
|
|
|
|
} |
2750
|
|
|
|
|
|
|
|
2751
|
1
|
|
|
|
|
|
void frexp_F128(pTHX_ float128 * frac, SV * exp, float128 * op) { |
2752
|
|
|
|
|
|
|
int e; |
2753
|
1
|
|
|
|
|
|
*frac = frexpq(*op, &e); |
2754
|
1
|
|
|
|
|
|
sv_setsv(exp, newSViv(e)); |
2755
|
1
|
|
|
|
|
|
} |
2756
|
|
|
|
|
|
|
|
2757
|
1
|
|
|
|
|
|
void ldexp_F128(float128 * rop, float128 * op, int pow) { |
2758
|
1
|
|
|
|
|
|
*rop = ldexpq(*op, pow); |
2759
|
1
|
|
|
|
|
|
} |
2760
|
|
|
|
|
|
|
|
2761
|
16
|
|
|
|
|
|
int isinf_F128(float128 * op) { |
2762
|
16
|
|
|
|
|
|
return isinfq(*op); |
2763
|
|
|
|
|
|
|
} |
2764
|
|
|
|
|
|
|
|
2765
|
1
|
|
|
|
|
|
int ilogb_F128(float128 * op) { |
2766
|
1
|
|
|
|
|
|
return ilogbq(*op); |
2767
|
|
|
|
|
|
|
} |
2768
|
|
|
|
|
|
|
|
2769
|
20
|
|
|
|
|
|
int isnan_F128(float128 * op) { |
2770
|
20
|
|
|
|
|
|
return isnanq(*op); |
2771
|
|
|
|
|
|
|
} |
2772
|
|
|
|
|
|
|
|
2773
|
1
|
|
|
|
|
|
void j0_F128(float128 * rop, float128 * op) { |
2774
|
1
|
|
|
|
|
|
*rop = j0q(*op); |
2775
|
1
|
|
|
|
|
|
} |
2776
|
|
|
|
|
|
|
|
2777
|
1
|
|
|
|
|
|
void j1_F128(float128 * rop, float128 * op) { |
2778
|
1
|
|
|
|
|
|
*rop = j1q(*op); |
2779
|
1
|
|
|
|
|
|
} |
2780
|
|
|
|
|
|
|
|
2781
|
1
|
|
|
|
|
|
void jn_F128(float128 * rop, int n, float128 * op) { |
2782
|
1
|
|
|
|
|
|
*rop = jnq(n, *op); |
2783
|
1
|
|
|
|
|
|
} |
2784
|
|
|
|
|
|
|
|
2785
|
1
|
|
|
|
|
|
void lgamma_F128(float128 * rop, float128 * op) { |
2786
|
1
|
|
|
|
|
|
*rop = lgammaq(*op); |
2787
|
1
|
|
|
|
|
|
} |
2788
|
|
|
|
|
|
|
|
2789
|
2
|
|
|
|
|
|
SV * llrint_F128(pTHX_ float128 * op) { |
2790
|
|
|
|
|
|
|
#ifdef LONGLONG2IV_IS_OK |
2791
|
2
|
|
|
|
|
|
return newSViv((IV)llrintq(*op)); |
2792
|
|
|
|
|
|
|
#else |
2793
|
|
|
|
|
|
|
warn("llrint_F128 not implemented: IV size (%d) is smaller than longlong size (%d)\n", sizeof(IV), sizeof(long long int)); |
2794
|
|
|
|
|
|
|
croak("Use lrint_F128 instead"); |
2795
|
|
|
|
|
|
|
#endif |
2796
|
|
|
|
|
|
|
} |
2797
|
|
|
|
|
|
|
|
2798
|
2
|
|
|
|
|
|
SV * llround_F128(pTHX_ float128 * op) { |
2799
|
|
|
|
|
|
|
#ifdef LONGLONG2IV_IS_OK |
2800
|
2
|
|
|
|
|
|
return newSViv((IV)llroundq(*op)); |
2801
|
|
|
|
|
|
|
#else |
2802
|
|
|
|
|
|
|
warn("llround_F128 not implemented: IV size (%d) is smaller than longlong size (%d)\n", sizeof(IV), sizeof(long long int)); |
2803
|
|
|
|
|
|
|
croak("Use lround_F128 instead"); |
2804
|
|
|
|
|
|
|
#endif |
2805
|
|
|
|
|
|
|
} |
2806
|
|
|
|
|
|
|
|
2807
|
2
|
|
|
|
|
|
SV * lrint_F128(pTHX_ float128 * op) { |
2808
|
|
|
|
|
|
|
#ifdef LONG2IV_IS_OK |
2809
|
2
|
|
|
|
|
|
return newSViv((IV)lrintq(*op)); |
2810
|
|
|
|
|
|
|
#else |
2811
|
|
|
|
|
|
|
croak("lrint_F128 not implemented: IV size (%d) is smaller than long size (%d)", sizeof(IV), sizeof(long)); |
2812
|
|
|
|
|
|
|
#endif |
2813
|
|
|
|
|
|
|
} |
2814
|
|
|
|
|
|
|
|
2815
|
2
|
|
|
|
|
|
SV * lround_F128(pTHX_ float128 * op) { |
2816
|
|
|
|
|
|
|
#ifdef LONG2IV_IS_OK |
2817
|
2
|
|
|
|
|
|
return newSViv((IV)lroundq(*op)); |
2818
|
|
|
|
|
|
|
#else |
2819
|
|
|
|
|
|
|
croak("lround_F128 not implemented: IV size (%d) is smaller than long size (%d)", sizeof(IV), sizeof(long)); |
2820
|
|
|
|
|
|
|
#endif |
2821
|
|
|
|
|
|
|
} |
2822
|
|
|
|
|
|
|
|
2823
|
1
|
|
|
|
|
|
void log_F128(float128 * rop, float128 * op) { |
2824
|
1
|
|
|
|
|
|
*rop = logq(*op); |
2825
|
1
|
|
|
|
|
|
} |
2826
|
|
|
|
|
|
|
|
2827
|
1
|
|
|
|
|
|
void log10_F128(float128 * rop, float128 * op) { |
2828
|
1
|
|
|
|
|
|
*rop = log10q(*op); |
2829
|
1
|
|
|
|
|
|
} |
2830
|
|
|
|
|
|
|
|
2831
|
1
|
|
|
|
|
|
void log2_F128(float128 * rop, float128 * op) { |
2832
|
1
|
|
|
|
|
|
*rop = log2q(*op); |
2833
|
1
|
|
|
|
|
|
} |
2834
|
|
|
|
|
|
|
|
2835
|
1
|
|
|
|
|
|
void log1p_F128(float128 * rop, float128 * op) { |
2836
|
1
|
|
|
|
|
|
*rop = log1pq(*op); |
2837
|
1
|
|
|
|
|
|
} |
2838
|
|
|
|
|
|
|
|
2839
|
1
|
|
|
|
|
|
void modf_F128(float128 * integer, float128 * frac, float128 * op) { |
2840
|
|
|
|
|
|
|
float128 ret; |
2841
|
1
|
|
|
|
|
|
*frac = modfq(*op, &ret); |
2842
|
1
|
|
|
|
|
|
*integer = ret; |
2843
|
1
|
|
|
|
|
|
} |
2844
|
|
|
|
|
|
|
|
2845
|
1
|
|
|
|
|
|
void nan_F128(pTHX_ float128 * rop, SV * op) { |
2846
|
1
|
50
|
|
|
|
|
*rop = nanq(SvPV_nolen(op)); |
2847
|
1
|
|
|
|
|
|
} |
2848
|
|
|
|
|
|
|
|
2849
|
6
|
|
|
|
|
|
void nearbyint_F128(float128 * rop, float128 * op) { |
2850
|
|
|
|
|
|
|
#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 4 /* avoid calling nearbyintq() as it's buggy */ |
2851
|
|
|
|
|
|
|
float128 do_floor, do_ceil; |
2852
|
|
|
|
|
|
|
int rnd = fegetround(); |
2853
|
|
|
|
|
|
|
if(*op == 0.0Q || isinfq(*op) || isnanq(*op)) { |
2854
|
|
|
|
|
|
|
*rop = *op; |
2855
|
|
|
|
|
|
|
return; |
2856
|
|
|
|
|
|
|
} |
2857
|
|
|
|
|
|
|
do_floor = *op - floorq(*op); |
2858
|
|
|
|
|
|
|
do_ceil = ceilq(*op) - *op; |
2859
|
|
|
|
|
|
|
if(do_ceil < do_floor) { |
2860
|
|
|
|
|
|
|
*rop = ceilq(*op); |
2861
|
|
|
|
|
|
|
return; |
2862
|
|
|
|
|
|
|
} |
2863
|
|
|
|
|
|
|
if(do_ceil > do_floor) { |
2864
|
|
|
|
|
|
|
*rop = floorq(*op); |
2865
|
|
|
|
|
|
|
return; |
2866
|
|
|
|
|
|
|
} |
2867
|
|
|
|
|
|
|
if(do_floor == do_ceil) { |
2868
|
|
|
|
|
|
|
if(rnd == FE_TONEAREST) { |
2869
|
|
|
|
|
|
|
if(remainderq(floorq(*op), 2.0Q) == 0.0Q) *rop = floorq(*op); |
2870
|
|
|
|
|
|
|
else *rop = ceilq(*op); |
2871
|
|
|
|
|
|
|
return; |
2872
|
|
|
|
|
|
|
} |
2873
|
|
|
|
|
|
|
if(rnd == FE_UPWARD) { |
2874
|
|
|
|
|
|
|
*rop = ceilq(*op); |
2875
|
|
|
|
|
|
|
return; |
2876
|
|
|
|
|
|
|
} |
2877
|
|
|
|
|
|
|
if(rnd == FE_DOWNWARD) { |
2878
|
|
|
|
|
|
|
*rop = floorq(*op); |
2879
|
|
|
|
|
|
|
return; |
2880
|
|
|
|
|
|
|
} |
2881
|
|
|
|
|
|
|
if(rnd == FE_TOWARDZERO) { |
2882
|
|
|
|
|
|
|
if(*op < 0.0Q) *rop = ceilq(*op); |
2883
|
|
|
|
|
|
|
if(*op > 0.0Q) *rop = floorq(*op); |
2884
|
|
|
|
|
|
|
return; |
2885
|
|
|
|
|
|
|
} |
2886
|
|
|
|
|
|
|
croak("nearbyint_F128 workaround for mingw64 compiler failed\n"); |
2887
|
|
|
|
|
|
|
} |
2888
|
|
|
|
|
|
|
#else |
2889
|
6
|
|
|
|
|
|
*rop = nearbyintq(*op); |
2890
|
|
|
|
|
|
|
#endif |
2891
|
6
|
|
|
|
|
|
} |
2892
|
|
|
|
|
|
|
|
2893
|
2
|
|
|
|
|
|
void nextafter_F128(float128 * rop, float128 * op1, float128 * op2) { |
2894
|
2
|
|
|
|
|
|
*rop = nextafterq(*op1, *op2); |
2895
|
2
|
|
|
|
|
|
} |
2896
|
|
|
|
|
|
|
|
2897
|
1
|
|
|
|
|
|
void pow_F128(float128 * rop, float128 * op1, float128 * op2) { |
2898
|
1
|
|
|
|
|
|
*rop = powq(*op1, *op2); |
2899
|
1
|
|
|
|
|
|
} |
2900
|
|
|
|
|
|
|
|
2901
|
1
|
|
|
|
|
|
void remainder_F128(float128 * rop, float128 * op1, float128 * op2) { |
2902
|
1
|
|
|
|
|
|
*rop = remainderq(*op1, *op2); |
2903
|
1
|
|
|
|
|
|
} |
2904
|
|
|
|
|
|
|
|
2905
|
1
|
|
|
|
|
|
void remquo_F128(pTHX_ float128 * rop1, SV * rop2, float128 * op1, float128 * op2) { |
2906
|
|
|
|
|
|
|
int ret; |
2907
|
1
|
|
|
|
|
|
*rop1 = remquoq(*op1, *op2, &ret); |
2908
|
1
|
|
|
|
|
|
sv_setsv(rop2, newSViv(ret)); |
2909
|
1
|
|
|
|
|
|
} |
2910
|
|
|
|
|
|
|
|
2911
|
2
|
|
|
|
|
|
void rint_F128(float128 * rop, float128 * op) { |
2912
|
2
|
|
|
|
|
|
*rop = rintq(*op); |
2913
|
2
|
|
|
|
|
|
} |
2914
|
|
|
|
|
|
|
|
2915
|
2
|
|
|
|
|
|
void round_F128(float128 * rop, float128 * op) { |
2916
|
2
|
|
|
|
|
|
*rop = roundq(*op); |
2917
|
2
|
|
|
|
|
|
} |
2918
|
|
|
|
|
|
|
|
2919
|
1
|
|
|
|
|
|
void scalbln_F128(float128 * rop, float128 * op1, long op2) { |
2920
|
1
|
|
|
|
|
|
*rop = scalblnq(*op1, op2); |
2921
|
1
|
|
|
|
|
|
} |
2922
|
|
|
|
|
|
|
|
2923
|
1
|
|
|
|
|
|
void scalbn_F128(float128 * rop, float128 * op1, int op2) { |
2924
|
1
|
|
|
|
|
|
*rop = scalbnq(*op1, op2); |
2925
|
1
|
|
|
|
|
|
} |
2926
|
|
|
|
|
|
|
|
2927
|
2
|
|
|
|
|
|
int signbit_F128(float128 * op) { |
2928
|
2
|
|
|
|
|
|
return signbitq(*op); |
2929
|
|
|
|
|
|
|
} |
2930
|
|
|
|
|
|
|
|
2931
|
1
|
|
|
|
|
|
void sincos_F128(float128 * sin, float128 * cos, float128 * op) { |
2932
|
|
|
|
|
|
|
float128 sine, cosine; |
2933
|
1
|
|
|
|
|
|
sincosq(*op, &sine, &cosine); |
2934
|
1
|
|
|
|
|
|
*sin = sine; |
2935
|
1
|
|
|
|
|
|
*cos = cosine; |
2936
|
1
|
|
|
|
|
|
} |
2937
|
|
|
|
|
|
|
|
2938
|
1
|
|
|
|
|
|
void sinh_F128(float128 * rop, float128 * op) { |
2939
|
1
|
|
|
|
|
|
*rop = sinhq(*op); |
2940
|
1
|
|
|
|
|
|
} |
2941
|
|
|
|
|
|
|
|
2942
|
1
|
|
|
|
|
|
void sin_F128(float128 * rop, float128 * op) { |
2943
|
1
|
|
|
|
|
|
*rop = sinq(*op); |
2944
|
1
|
|
|
|
|
|
} |
2945
|
|
|
|
|
|
|
|
2946
|
1
|
|
|
|
|
|
void sqrt_F128(float128 * rop, float128 * op) { |
2947
|
1
|
|
|
|
|
|
*rop = sqrtq(*op); |
2948
|
1
|
|
|
|
|
|
} |
2949
|
|
|
|
|
|
|
|
2950
|
1
|
|
|
|
|
|
void tan_F128(float128 * rop, float128 * op) { |
2951
|
1
|
|
|
|
|
|
*rop = tanq(*op); |
2952
|
1
|
|
|
|
|
|
} |
2953
|
|
|
|
|
|
|
|
2954
|
1
|
|
|
|
|
|
void tanh_F128(float128 * rop, float128 * op) { |
2955
|
1
|
|
|
|
|
|
*rop = tanhq(*op); |
2956
|
1
|
|
|
|
|
|
} |
2957
|
|
|
|
|
|
|
|
2958
|
1
|
|
|
|
|
|
void tgamma_F128(float128 * rop, float128 * op) { |
2959
|
|
|
|
|
|
|
#if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 4 /* avoid calling tgammaq() as it's buggy */ |
2960
|
|
|
|
|
|
|
*rop = powq(M_Eq, lgammaq(*op)); |
2961
|
|
|
|
|
|
|
#else |
2962
|
1
|
|
|
|
|
|
*rop = tgammaq(*op); |
2963
|
|
|
|
|
|
|
#endif |
2964
|
1
|
|
|
|
|
|
} |
2965
|
|
|
|
|
|
|
|
2966
|
1
|
|
|
|
|
|
void trunc_F128(float128 * rop, float128 * op) { |
2967
|
1
|
|
|
|
|
|
*rop = truncq(*op); |
2968
|
1
|
|
|
|
|
|
} |
2969
|
|
|
|
|
|
|
|
2970
|
1
|
|
|
|
|
|
void y0_F128(float128 * rop, float128 * op) { |
2971
|
1
|
|
|
|
|
|
*rop = y0q(*op); |
2972
|
1
|
|
|
|
|
|
} |
2973
|
|
|
|
|
|
|
|
2974
|
1
|
|
|
|
|
|
void y1_F128(float128 * rop, float128 * op) { |
2975
|
1
|
|
|
|
|
|
*rop = y1q(*op); |
2976
|
1
|
|
|
|
|
|
} |
2977
|
|
|
|
|
|
|
|
2978
|
1
|
|
|
|
|
|
void yn_F128(float128 * rop, int n, float128 * op) { |
2979
|
1
|
|
|
|
|
|
*rop = ynq(n, *op); |
2980
|
1
|
|
|
|
|
|
} |
2981
|
|
|
|
|
|
|
|
2982
|
1
|
|
|
|
|
|
int _longlong2iv_is_ok(void) { |
2983
|
|
|
|
|
|
|
|
2984
|
|
|
|
|
|
|
/* Is longlong to IV conversion guaranteed to not lose precision ? */ |
2985
|
|
|
|
|
|
|
#ifdef LONGLONG2IV_IS_OK |
2986
|
1
|
|
|
|
|
|
return 1; |
2987
|
|
|
|
|
|
|
#else |
2988
|
|
|
|
|
|
|
return 0; |
2989
|
|
|
|
|
|
|
#endif |
2990
|
|
|
|
|
|
|
|
2991
|
|
|
|
|
|
|
} |
2992
|
|
|
|
|
|
|
|
2993
|
|
|
|
|
|
|
/* Is long to IV conversion guaranteed to not lose precision ? */ |
2994
|
1
|
|
|
|
|
|
int _long2iv_is_ok(void) { |
2995
|
|
|
|
|
|
|
|
2996
|
|
|
|
|
|
|
#ifdef LONG2IV_IS_OK |
2997
|
1
|
|
|
|
|
|
return 1; |
2998
|
|
|
|
|
|
|
#else |
2999
|
|
|
|
|
|
|
return 0; |
3000
|
|
|
|
|
|
|
#endif |
3001
|
|
|
|
|
|
|
|
3002
|
|
|
|
|
|
|
} |
3003
|
|
|
|
|
|
|
|
3004
|
|
|
|
|
|
|
/* FLT_RADIX is probably 2, but we can use this if we need to be sure. */ |
3005
|
1
|
|
|
|
|
|
int _flt_radix(void) { |
3006
|
|
|
|
|
|
|
#ifdef FLT_RADIX |
3007
|
1
|
|
|
|
|
|
return (int)FLT_RADIX; |
3008
|
|
|
|
|
|
|
#else |
3009
|
|
|
|
|
|
|
return 0; |
3010
|
|
|
|
|
|
|
#endif |
3011
|
|
|
|
|
|
|
} |
3012
|
|
|
|
|
|
|
|
3013
|
1
|
|
|
|
|
|
SV * _fegetround(pTHX) { |
3014
|
|
|
|
|
|
|
#ifdef __MINGW64_VERSION_MAJOR /* fenv.h has been included */ |
3015
|
|
|
|
|
|
|
int r = fegetround(); |
3016
|
|
|
|
|
|
|
if(r == FE_TONEAREST) return newSVpv("FE_TONEAREST", 0); |
3017
|
|
|
|
|
|
|
if(r == FE_TOWARDZERO) return newSVpv("FE_TOWARDZERO", 0); |
3018
|
|
|
|
|
|
|
if(r == FE_UPWARD) return newSVpv("FE_UPWARD", 0); |
3019
|
|
|
|
|
|
|
if(r == FE_DOWNWARD) return newSVpv("FE_DOWNWARD", 0); |
3020
|
|
|
|
|
|
|
return newSVpv("Unknown rounding mode", 0); |
3021
|
|
|
|
|
|
|
#else |
3022
|
1
|
|
|
|
|
|
return newSVpv("Rounding mode undetermined - fenv.h not loaded", 0); |
3023
|
|
|
|
|
|
|
#endif |
3024
|
|
|
|
|
|
|
} |
3025
|
|
|
|
|
|
|
|
3026
|
7
|
|
|
|
|
|
int nnumflag(void) { |
3027
|
7
|
|
|
|
|
|
return nnum; |
3028
|
|
|
|
|
|
|
} |
3029
|
|
|
|
|
|
|
|
3030
|
1
|
|
|
|
|
|
void clear_nnum(void) { |
3031
|
1
|
|
|
|
|
|
nnum = 0; |
3032
|
1
|
|
|
|
|
|
} |
3033
|
|
|
|
|
|
|
|
3034
|
1
|
|
|
|
|
|
void set_nnum(int x) { |
3035
|
1
|
|
|
|
|
|
nnum = x; |
3036
|
1
|
|
|
|
|
|
} |
3037
|
|
|
|
|
|
|
|
3038
|
0
|
|
|
|
|
|
int _lln(pTHX_ SV * x) { |
3039
|
0
|
0
|
|
|
|
|
if(looks_like_number(x)) return 1; |
3040
|
0
|
|
|
|
|
|
return 0; |
3041
|
|
|
|
|
|
|
} |
3042
|
|
|
|
|
|
|
|
3043
|
25
|
|
|
|
|
|
int nok_pokflag(void) { |
3044
|
25
|
|
|
|
|
|
return nok_pok; |
3045
|
|
|
|
|
|
|
} |
3046
|
|
|
|
|
|
|
|
3047
|
0
|
|
|
|
|
|
void clear_nok_pok(void){ |
3048
|
0
|
|
|
|
|
|
nok_pok = 0; |
3049
|
0
|
|
|
|
|
|
} |
3050
|
|
|
|
|
|
|
|
3051
|
3
|
|
|
|
|
|
void set_nok_pok(int x) { |
3052
|
3
|
|
|
|
|
|
nok_pok = x; |
3053
|
3
|
|
|
|
|
|
} |
3054
|
|
|
|
|
|
|
|
3055
|
116
|
|
|
|
|
|
int _SvNOK(pTHX_ SV * in) { |
3056
|
116
|
100
|
|
|
|
|
if(SvNOK(in)) return 1; |
3057
|
93
|
|
|
|
|
|
return 0; |
3058
|
|
|
|
|
|
|
} |
3059
|
|
|
|
|
|
|
|
3060
|
20
|
|
|
|
|
|
int _SvPOK(pTHX_ SV * in) { |
3061
|
20
|
50
|
|
|
|
|
if(SvPOK(in)) return 1; |
3062
|
0
|
|
|
|
|
|
return 0; |
3063
|
|
|
|
|
|
|
} |
3064
|
|
|
|
|
|
|
|
3065
|
1
|
|
|
|
|
|
int _avoid_inf_cast(void) { |
3066
|
|
|
|
|
|
|
#if defined(AVOID_INF_CAST) |
3067
|
|
|
|
|
|
|
return 1; |
3068
|
|
|
|
|
|
|
#else |
3069
|
1
|
|
|
|
|
|
return 0; |
3070
|
|
|
|
|
|
|
#endif |
3071
|
|
|
|
|
|
|
} |
3072
|
|
|
|
|
|
|
|
3073
|
|
|
|
|
|
|
|
3074
|
|
|
|
|
|
|
MODULE = Math::Float128 PACKAGE = Math::Float128 |
3075
|
|
|
|
|
|
|
|
3076
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
3077
|
|
|
|
|
|
|
|
3078
|
|
|
|
|
|
|
|
3079
|
|
|
|
|
|
|
int |
3080
|
|
|
|
|
|
|
NOK_POK_val () |
3081
|
|
|
|
|
|
|
CODE: |
3082
|
0
|
|
|
|
|
|
RETVAL = NOK_POK_val (aTHX); |
3083
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3084
|
|
|
|
|
|
|
|
3085
|
|
|
|
|
|
|
|
3086
|
|
|
|
|
|
|
int |
3087
|
|
|
|
|
|
|
_win32_infnanstring (s) |
3088
|
|
|
|
|
|
|
char * s |
3089
|
|
|
|
|
|
|
|
3090
|
|
|
|
|
|
|
void |
3091
|
|
|
|
|
|
|
flt128_set_prec (x) |
3092
|
|
|
|
|
|
|
int x |
3093
|
|
|
|
|
|
|
PREINIT: |
3094
|
|
|
|
|
|
|
I32* temp; |
3095
|
|
|
|
|
|
|
PPCODE: |
3096
|
3
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3097
|
3
|
|
|
|
|
|
flt128_set_prec(aTHX_ x); |
3098
|
2
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3099
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3100
|
2
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3101
|
2
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3102
|
|
|
|
|
|
|
} |
3103
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3104
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3105
|
|
|
|
|
|
|
|
3106
|
|
|
|
|
|
|
int |
3107
|
|
|
|
|
|
|
flt128_get_prec () |
3108
|
|
|
|
|
|
|
|
3109
|
|
|
|
|
|
|
|
3110
|
|
|
|
|
|
|
SV * |
3111
|
|
|
|
|
|
|
InfF128 (sign) |
3112
|
|
|
|
|
|
|
int sign |
3113
|
|
|
|
|
|
|
CODE: |
3114
|
14
|
|
|
|
|
|
RETVAL = InfF128 (aTHX_ sign); |
3115
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3116
|
|
|
|
|
|
|
|
3117
|
|
|
|
|
|
|
SV * |
3118
|
|
|
|
|
|
|
NaNF128 () |
3119
|
|
|
|
|
|
|
CODE: |
3120
|
29
|
|
|
|
|
|
RETVAL = NaNF128 (aTHX); |
3121
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3122
|
|
|
|
|
|
|
|
3123
|
|
|
|
|
|
|
|
3124
|
|
|
|
|
|
|
SV * |
3125
|
|
|
|
|
|
|
ZeroF128 (sign) |
3126
|
|
|
|
|
|
|
int sign |
3127
|
|
|
|
|
|
|
CODE: |
3128
|
23
|
|
|
|
|
|
RETVAL = ZeroF128 (aTHX_ sign); |
3129
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3130
|
|
|
|
|
|
|
|
3131
|
|
|
|
|
|
|
SV * |
3132
|
|
|
|
|
|
|
UnityF128 (sign) |
3133
|
|
|
|
|
|
|
int sign |
3134
|
|
|
|
|
|
|
CODE: |
3135
|
39
|
|
|
|
|
|
RETVAL = UnityF128 (aTHX_ sign); |
3136
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3137
|
|
|
|
|
|
|
|
3138
|
|
|
|
|
|
|
SV * |
3139
|
|
|
|
|
|
|
is_NaNF128 (b) |
3140
|
|
|
|
|
|
|
SV * b |
3141
|
|
|
|
|
|
|
CODE: |
3142
|
10
|
|
|
|
|
|
RETVAL = is_NaNF128 (aTHX_ b); |
3143
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3144
|
|
|
|
|
|
|
|
3145
|
|
|
|
|
|
|
SV * |
3146
|
|
|
|
|
|
|
is_InfF128 (b) |
3147
|
|
|
|
|
|
|
SV * b |
3148
|
|
|
|
|
|
|
CODE: |
3149
|
6
|
|
|
|
|
|
RETVAL = is_InfF128 (aTHX_ b); |
3150
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3151
|
|
|
|
|
|
|
|
3152
|
|
|
|
|
|
|
SV * |
3153
|
|
|
|
|
|
|
is_ZeroF128 (b) |
3154
|
|
|
|
|
|
|
SV * b |
3155
|
|
|
|
|
|
|
CODE: |
3156
|
16
|
|
|
|
|
|
RETVAL = is_ZeroF128 (aTHX_ b); |
3157
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3158
|
|
|
|
|
|
|
|
3159
|
|
|
|
|
|
|
void |
3160
|
|
|
|
|
|
|
_nnum_inc (p) |
3161
|
|
|
|
|
|
|
char * p |
3162
|
|
|
|
|
|
|
PREINIT: |
3163
|
|
|
|
|
|
|
I32* temp; |
3164
|
|
|
|
|
|
|
PPCODE: |
3165
|
0
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3166
|
0
|
|
|
|
|
|
_nnum_inc(p); |
3167
|
0
|
0
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3168
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3169
|
0
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3170
|
0
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3171
|
|
|
|
|
|
|
} |
3172
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3173
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3174
|
|
|
|
|
|
|
|
3175
|
|
|
|
|
|
|
SV * |
3176
|
|
|
|
|
|
|
STRtoF128 (str) |
3177
|
|
|
|
|
|
|
SV * str |
3178
|
|
|
|
|
|
|
CODE: |
3179
|
157
|
|
|
|
|
|
RETVAL = STRtoF128 (aTHX_ str); |
3180
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3181
|
|
|
|
|
|
|
|
3182
|
|
|
|
|
|
|
void |
3183
|
|
|
|
|
|
|
fromSTR (f, str) |
3184
|
|
|
|
|
|
|
float128 * f |
3185
|
|
|
|
|
|
|
SV * str |
3186
|
|
|
|
|
|
|
PREINIT: |
3187
|
|
|
|
|
|
|
I32* temp; |
3188
|
|
|
|
|
|
|
PPCODE: |
3189
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3190
|
1
|
|
|
|
|
|
fromSTR(aTHX_ f, str); |
3191
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3192
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3193
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3194
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3195
|
|
|
|
|
|
|
} |
3196
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3197
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3198
|
|
|
|
|
|
|
|
3199
|
|
|
|
|
|
|
SV * |
3200
|
|
|
|
|
|
|
NVtoF128 (nv) |
3201
|
|
|
|
|
|
|
SV * nv |
3202
|
|
|
|
|
|
|
CODE: |
3203
|
215
|
|
|
|
|
|
RETVAL = NVtoF128 (aTHX_ nv); |
3204
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3205
|
|
|
|
|
|
|
|
3206
|
|
|
|
|
|
|
void |
3207
|
|
|
|
|
|
|
fromNV (f, nv) |
3208
|
|
|
|
|
|
|
float128 * f |
3209
|
|
|
|
|
|
|
SV * nv |
3210
|
|
|
|
|
|
|
PREINIT: |
3211
|
|
|
|
|
|
|
I32* temp; |
3212
|
|
|
|
|
|
|
PPCODE: |
3213
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3214
|
1
|
|
|
|
|
|
fromNV(aTHX_ f, nv); |
3215
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3216
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3217
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3218
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3219
|
|
|
|
|
|
|
} |
3220
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3221
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3222
|
|
|
|
|
|
|
|
3223
|
|
|
|
|
|
|
SV * |
3224
|
|
|
|
|
|
|
IVtoF128 (iv) |
3225
|
|
|
|
|
|
|
SV * iv |
3226
|
|
|
|
|
|
|
CODE: |
3227
|
157
|
|
|
|
|
|
RETVAL = IVtoF128 (aTHX_ iv); |
3228
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3229
|
|
|
|
|
|
|
|
3230
|
|
|
|
|
|
|
void |
3231
|
|
|
|
|
|
|
fromIV (f, iv) |
3232
|
|
|
|
|
|
|
float128 * f |
3233
|
|
|
|
|
|
|
SV * iv |
3234
|
|
|
|
|
|
|
PREINIT: |
3235
|
|
|
|
|
|
|
I32* temp; |
3236
|
|
|
|
|
|
|
PPCODE: |
3237
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3238
|
1
|
|
|
|
|
|
fromIV(aTHX_ f, iv); |
3239
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3240
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3241
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3242
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3243
|
|
|
|
|
|
|
} |
3244
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3245
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3246
|
|
|
|
|
|
|
|
3247
|
|
|
|
|
|
|
SV * |
3248
|
|
|
|
|
|
|
UVtoF128 (uv) |
3249
|
|
|
|
|
|
|
SV * uv |
3250
|
|
|
|
|
|
|
CODE: |
3251
|
37
|
|
|
|
|
|
RETVAL = UVtoF128 (aTHX_ uv); |
3252
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3253
|
|
|
|
|
|
|
|
3254
|
|
|
|
|
|
|
void |
3255
|
|
|
|
|
|
|
fromUV (f, uv) |
3256
|
|
|
|
|
|
|
float128 * f |
3257
|
|
|
|
|
|
|
SV * uv |
3258
|
|
|
|
|
|
|
PREINIT: |
3259
|
|
|
|
|
|
|
I32* temp; |
3260
|
|
|
|
|
|
|
PPCODE: |
3261
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3262
|
1
|
|
|
|
|
|
fromUV(aTHX_ f, uv); |
3263
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3264
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3265
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3266
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3267
|
|
|
|
|
|
|
} |
3268
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3269
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3270
|
|
|
|
|
|
|
|
3271
|
|
|
|
|
|
|
void |
3272
|
|
|
|
|
|
|
F128toSTR (f) |
3273
|
|
|
|
|
|
|
SV * f |
3274
|
|
|
|
|
|
|
PREINIT: |
3275
|
|
|
|
|
|
|
I32* temp; |
3276
|
|
|
|
|
|
|
PPCODE: |
3277
|
3
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3278
|
3
|
|
|
|
|
|
F128toSTR(aTHX_ f); |
3279
|
3
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3280
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3281
|
0
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3282
|
0
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3283
|
|
|
|
|
|
|
} |
3284
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3285
|
3
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3286
|
|
|
|
|
|
|
|
3287
|
|
|
|
|
|
|
void |
3288
|
|
|
|
|
|
|
F128toSTRP (f, decimal_prec) |
3289
|
|
|
|
|
|
|
SV * f |
3290
|
|
|
|
|
|
|
int decimal_prec |
3291
|
|
|
|
|
|
|
PREINIT: |
3292
|
|
|
|
|
|
|
I32* temp; |
3293
|
|
|
|
|
|
|
PPCODE: |
3294
|
2
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3295
|
2
|
|
|
|
|
|
F128toSTRP(aTHX_ f, decimal_prec); |
3296
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3297
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3298
|
0
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3299
|
0
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3300
|
|
|
|
|
|
|
} |
3301
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3302
|
1
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3303
|
|
|
|
|
|
|
|
3304
|
|
|
|
|
|
|
void |
3305
|
|
|
|
|
|
|
DESTROY (f) |
3306
|
|
|
|
|
|
|
SV * f |
3307
|
|
|
|
|
|
|
PREINIT: |
3308
|
|
|
|
|
|
|
I32* temp; |
3309
|
|
|
|
|
|
|
PPCODE: |
3310
|
1083
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3311
|
1083
|
|
|
|
|
|
DESTROY(aTHX_ f); |
3312
|
1083
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3313
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3314
|
1083
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3315
|
1083
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3316
|
|
|
|
|
|
|
} |
3317
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3318
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3319
|
|
|
|
|
|
|
|
3320
|
|
|
|
|
|
|
SV * |
3321
|
|
|
|
|
|
|
_LDBL_DIG () |
3322
|
|
|
|
|
|
|
CODE: |
3323
|
0
|
|
|
|
|
|
RETVAL = _LDBL_DIG (aTHX); |
3324
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3325
|
|
|
|
|
|
|
|
3326
|
|
|
|
|
|
|
|
3327
|
|
|
|
|
|
|
SV * |
3328
|
|
|
|
|
|
|
_DBL_DIG () |
3329
|
|
|
|
|
|
|
CODE: |
3330
|
0
|
|
|
|
|
|
RETVAL = _DBL_DIG (aTHX); |
3331
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3332
|
|
|
|
|
|
|
|
3333
|
|
|
|
|
|
|
|
3334
|
|
|
|
|
|
|
SV * |
3335
|
|
|
|
|
|
|
_FLT128_DIG () |
3336
|
|
|
|
|
|
|
CODE: |
3337
|
2
|
|
|
|
|
|
RETVAL = _FLT128_DIG (aTHX); |
3338
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3339
|
|
|
|
|
|
|
|
3340
|
|
|
|
|
|
|
|
3341
|
|
|
|
|
|
|
SV * |
3342
|
|
|
|
|
|
|
_overload_add (a, b, third) |
3343
|
|
|
|
|
|
|
SV * a |
3344
|
|
|
|
|
|
|
SV * b |
3345
|
|
|
|
|
|
|
SV * third |
3346
|
|
|
|
|
|
|
CODE: |
3347
|
81
|
|
|
|
|
|
RETVAL = _overload_add (aTHX_ a, b, third); |
3348
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3349
|
|
|
|
|
|
|
|
3350
|
|
|
|
|
|
|
SV * |
3351
|
|
|
|
|
|
|
_overload_mul (a, b, third) |
3352
|
|
|
|
|
|
|
SV * a |
3353
|
|
|
|
|
|
|
SV * b |
3354
|
|
|
|
|
|
|
SV * third |
3355
|
|
|
|
|
|
|
CODE: |
3356
|
16
|
|
|
|
|
|
RETVAL = _overload_mul (aTHX_ a, b, third); |
3357
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3358
|
|
|
|
|
|
|
|
3359
|
|
|
|
|
|
|
SV * |
3360
|
|
|
|
|
|
|
_overload_sub (a, b, third) |
3361
|
|
|
|
|
|
|
SV * a |
3362
|
|
|
|
|
|
|
SV * b |
3363
|
|
|
|
|
|
|
SV * third |
3364
|
|
|
|
|
|
|
CODE: |
3365
|
145
|
|
|
|
|
|
RETVAL = _overload_sub (aTHX_ a, b, third); |
3366
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3367
|
|
|
|
|
|
|
|
3368
|
|
|
|
|
|
|
SV * |
3369
|
|
|
|
|
|
|
_overload_div (a, b, third) |
3370
|
|
|
|
|
|
|
SV * a |
3371
|
|
|
|
|
|
|
SV * b |
3372
|
|
|
|
|
|
|
SV * third |
3373
|
|
|
|
|
|
|
CODE: |
3374
|
21
|
|
|
|
|
|
RETVAL = _overload_div (aTHX_ a, b, third); |
3375
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3376
|
|
|
|
|
|
|
|
3377
|
|
|
|
|
|
|
SV * |
3378
|
|
|
|
|
|
|
_overload_equiv (a, b, third) |
3379
|
|
|
|
|
|
|
SV * a |
3380
|
|
|
|
|
|
|
SV * b |
3381
|
|
|
|
|
|
|
SV * third |
3382
|
|
|
|
|
|
|
CODE: |
3383
|
200
|
|
|
|
|
|
RETVAL = _overload_equiv (aTHX_ a, b, third); |
3384
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3385
|
|
|
|
|
|
|
|
3386
|
|
|
|
|
|
|
SV * |
3387
|
|
|
|
|
|
|
_overload_not_equiv (a, b, third) |
3388
|
|
|
|
|
|
|
SV * a |
3389
|
|
|
|
|
|
|
SV * b |
3390
|
|
|
|
|
|
|
SV * third |
3391
|
|
|
|
|
|
|
CODE: |
3392
|
26
|
|
|
|
|
|
RETVAL = _overload_not_equiv (aTHX_ a, b, third); |
3393
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3394
|
|
|
|
|
|
|
|
3395
|
|
|
|
|
|
|
SV * |
3396
|
|
|
|
|
|
|
_overload_true (a, b, third) |
3397
|
|
|
|
|
|
|
SV * a |
3398
|
|
|
|
|
|
|
SV * b |
3399
|
|
|
|
|
|
|
SV * third |
3400
|
|
|
|
|
|
|
CODE: |
3401
|
4
|
|
|
|
|
|
RETVAL = _overload_true (aTHX_ a, b, third); |
3402
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3403
|
|
|
|
|
|
|
|
3404
|
|
|
|
|
|
|
SV * |
3405
|
|
|
|
|
|
|
_overload_not (a, b, third) |
3406
|
|
|
|
|
|
|
SV * a |
3407
|
|
|
|
|
|
|
SV * b |
3408
|
|
|
|
|
|
|
SV * third |
3409
|
|
|
|
|
|
|
CODE: |
3410
|
6
|
|
|
|
|
|
RETVAL = _overload_not (aTHX_ a, b, third); |
3411
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3412
|
|
|
|
|
|
|
|
3413
|
|
|
|
|
|
|
SV * |
3414
|
|
|
|
|
|
|
_overload_add_eq (a, b, third) |
3415
|
|
|
|
|
|
|
SV * a |
3416
|
|
|
|
|
|
|
SV * b |
3417
|
|
|
|
|
|
|
SV * third |
3418
|
|
|
|
|
|
|
CODE: |
3419
|
16
|
|
|
|
|
|
RETVAL = _overload_add_eq (aTHX_ a, b, third); |
3420
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3421
|
|
|
|
|
|
|
|
3422
|
|
|
|
|
|
|
SV * |
3423
|
|
|
|
|
|
|
_overload_mul_eq (a, b, third) |
3424
|
|
|
|
|
|
|
SV * a |
3425
|
|
|
|
|
|
|
SV * b |
3426
|
|
|
|
|
|
|
SV * third |
3427
|
|
|
|
|
|
|
CODE: |
3428
|
15
|
|
|
|
|
|
RETVAL = _overload_mul_eq (aTHX_ a, b, third); |
3429
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3430
|
|
|
|
|
|
|
|
3431
|
|
|
|
|
|
|
SV * |
3432
|
|
|
|
|
|
|
_overload_sub_eq (a, b, third) |
3433
|
|
|
|
|
|
|
SV * a |
3434
|
|
|
|
|
|
|
SV * b |
3435
|
|
|
|
|
|
|
SV * third |
3436
|
|
|
|
|
|
|
CODE: |
3437
|
13
|
|
|
|
|
|
RETVAL = _overload_sub_eq (aTHX_ a, b, third); |
3438
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3439
|
|
|
|
|
|
|
|
3440
|
|
|
|
|
|
|
SV * |
3441
|
|
|
|
|
|
|
_overload_div_eq (a, b, third) |
3442
|
|
|
|
|
|
|
SV * a |
3443
|
|
|
|
|
|
|
SV * b |
3444
|
|
|
|
|
|
|
SV * third |
3445
|
|
|
|
|
|
|
CODE: |
3446
|
13
|
|
|
|
|
|
RETVAL = _overload_div_eq (aTHX_ a, b, third); |
3447
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3448
|
|
|
|
|
|
|
|
3449
|
|
|
|
|
|
|
SV * |
3450
|
|
|
|
|
|
|
_overload_lt (a, b, third) |
3451
|
|
|
|
|
|
|
SV * a |
3452
|
|
|
|
|
|
|
SV * b |
3453
|
|
|
|
|
|
|
SV * third |
3454
|
|
|
|
|
|
|
CODE: |
3455
|
46
|
|
|
|
|
|
RETVAL = _overload_lt (aTHX_ a, b, third); |
3456
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3457
|
|
|
|
|
|
|
|
3458
|
|
|
|
|
|
|
SV * |
3459
|
|
|
|
|
|
|
_overload_gt (a, b, third) |
3460
|
|
|
|
|
|
|
SV * a |
3461
|
|
|
|
|
|
|
SV * b |
3462
|
|
|
|
|
|
|
SV * third |
3463
|
|
|
|
|
|
|
CODE: |
3464
|
81
|
|
|
|
|
|
RETVAL = _overload_gt (aTHX_ a, b, third); |
3465
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3466
|
|
|
|
|
|
|
|
3467
|
|
|
|
|
|
|
SV * |
3468
|
|
|
|
|
|
|
_overload_lte (a, b, third) |
3469
|
|
|
|
|
|
|
SV * a |
3470
|
|
|
|
|
|
|
SV * b |
3471
|
|
|
|
|
|
|
SV * third |
3472
|
|
|
|
|
|
|
CODE: |
3473
|
40
|
|
|
|
|
|
RETVAL = _overload_lte (aTHX_ a, b, third); |
3474
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3475
|
|
|
|
|
|
|
|
3476
|
|
|
|
|
|
|
SV * |
3477
|
|
|
|
|
|
|
_overload_gte (a, b, third) |
3478
|
|
|
|
|
|
|
SV * a |
3479
|
|
|
|
|
|
|
SV * b |
3480
|
|
|
|
|
|
|
SV * third |
3481
|
|
|
|
|
|
|
CODE: |
3482
|
37
|
|
|
|
|
|
RETVAL = _overload_gte (aTHX_ a, b, third); |
3483
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3484
|
|
|
|
|
|
|
|
3485
|
|
|
|
|
|
|
SV * |
3486
|
|
|
|
|
|
|
_overload_spaceship (a, b, third) |
3487
|
|
|
|
|
|
|
SV * a |
3488
|
|
|
|
|
|
|
SV * b |
3489
|
|
|
|
|
|
|
SV * third |
3490
|
|
|
|
|
|
|
CODE: |
3491
|
65
|
|
|
|
|
|
RETVAL = _overload_spaceship (aTHX_ a, b, third); |
3492
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3493
|
|
|
|
|
|
|
|
3494
|
|
|
|
|
|
|
SV * |
3495
|
|
|
|
|
|
|
_overload_copy (a, b, third) |
3496
|
|
|
|
|
|
|
SV * a |
3497
|
|
|
|
|
|
|
SV * b |
3498
|
|
|
|
|
|
|
SV * third |
3499
|
|
|
|
|
|
|
CODE: |
3500
|
1
|
|
|
|
|
|
RETVAL = _overload_copy (aTHX_ a, b, third); |
3501
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3502
|
|
|
|
|
|
|
|
3503
|
|
|
|
|
|
|
SV * |
3504
|
|
|
|
|
|
|
F128toF128 (a) |
3505
|
|
|
|
|
|
|
SV * a |
3506
|
|
|
|
|
|
|
CODE: |
3507
|
26
|
|
|
|
|
|
RETVAL = F128toF128 (aTHX_ a); |
3508
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3509
|
|
|
|
|
|
|
|
3510
|
|
|
|
|
|
|
void |
3511
|
|
|
|
|
|
|
fromF128 (f, a) |
3512
|
|
|
|
|
|
|
float128 * f |
3513
|
|
|
|
|
|
|
SV * a |
3514
|
|
|
|
|
|
|
PREINIT: |
3515
|
|
|
|
|
|
|
I32* temp; |
3516
|
|
|
|
|
|
|
PPCODE: |
3517
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3518
|
1
|
|
|
|
|
|
fromF128(aTHX_ f, a); |
3519
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3520
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3521
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3522
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3523
|
|
|
|
|
|
|
} |
3524
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3525
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3526
|
|
|
|
|
|
|
|
3527
|
|
|
|
|
|
|
SV * |
3528
|
|
|
|
|
|
|
_itsa (a) |
3529
|
|
|
|
|
|
|
SV * a |
3530
|
|
|
|
|
|
|
CODE: |
3531
|
437
|
|
|
|
|
|
RETVAL = _itsa (aTHX_ a); |
3532
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3533
|
|
|
|
|
|
|
|
3534
|
|
|
|
|
|
|
SV * |
3535
|
|
|
|
|
|
|
_overload_abs (a, b, third) |
3536
|
|
|
|
|
|
|
SV * a |
3537
|
|
|
|
|
|
|
SV * b |
3538
|
|
|
|
|
|
|
SV * third |
3539
|
|
|
|
|
|
|
CODE: |
3540
|
63
|
|
|
|
|
|
RETVAL = _overload_abs (aTHX_ a, b, third); |
3541
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3542
|
|
|
|
|
|
|
|
3543
|
|
|
|
|
|
|
SV * |
3544
|
|
|
|
|
|
|
_overload_int (a, b, third) |
3545
|
|
|
|
|
|
|
SV * a |
3546
|
|
|
|
|
|
|
SV * b |
3547
|
|
|
|
|
|
|
SV * third |
3548
|
|
|
|
|
|
|
CODE: |
3549
|
11
|
|
|
|
|
|
RETVAL = _overload_int (aTHX_ a, b, third); |
3550
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3551
|
|
|
|
|
|
|
|
3552
|
|
|
|
|
|
|
SV * |
3553
|
|
|
|
|
|
|
_overload_sqrt (a, b, third) |
3554
|
|
|
|
|
|
|
SV * a |
3555
|
|
|
|
|
|
|
SV * b |
3556
|
|
|
|
|
|
|
SV * third |
3557
|
|
|
|
|
|
|
CODE: |
3558
|
4
|
|
|
|
|
|
RETVAL = _overload_sqrt (aTHX_ a, b, third); |
3559
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3560
|
|
|
|
|
|
|
|
3561
|
|
|
|
|
|
|
SV * |
3562
|
|
|
|
|
|
|
_overload_log (a, b, third) |
3563
|
|
|
|
|
|
|
SV * a |
3564
|
|
|
|
|
|
|
SV * b |
3565
|
|
|
|
|
|
|
SV * third |
3566
|
|
|
|
|
|
|
CODE: |
3567
|
4
|
|
|
|
|
|
RETVAL = _overload_log (aTHX_ a, b, third); |
3568
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3569
|
|
|
|
|
|
|
|
3570
|
|
|
|
|
|
|
SV * |
3571
|
|
|
|
|
|
|
_overload_exp (a, b, third) |
3572
|
|
|
|
|
|
|
SV * a |
3573
|
|
|
|
|
|
|
SV * b |
3574
|
|
|
|
|
|
|
SV * third |
3575
|
|
|
|
|
|
|
CODE: |
3576
|
1
|
|
|
|
|
|
RETVAL = _overload_exp (aTHX_ a, b, third); |
3577
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3578
|
|
|
|
|
|
|
|
3579
|
|
|
|
|
|
|
SV * |
3580
|
|
|
|
|
|
|
_overload_sin (a, b, third) |
3581
|
|
|
|
|
|
|
SV * a |
3582
|
|
|
|
|
|
|
SV * b |
3583
|
|
|
|
|
|
|
SV * third |
3584
|
|
|
|
|
|
|
CODE: |
3585
|
1
|
|
|
|
|
|
RETVAL = _overload_sin (aTHX_ a, b, third); |
3586
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3587
|
|
|
|
|
|
|
|
3588
|
|
|
|
|
|
|
SV * |
3589
|
|
|
|
|
|
|
_overload_cos (a, b, third) |
3590
|
|
|
|
|
|
|
SV * a |
3591
|
|
|
|
|
|
|
SV * b |
3592
|
|
|
|
|
|
|
SV * third |
3593
|
|
|
|
|
|
|
CODE: |
3594
|
1
|
|
|
|
|
|
RETVAL = _overload_cos (aTHX_ a, b, third); |
3595
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3596
|
|
|
|
|
|
|
|
3597
|
|
|
|
|
|
|
SV * |
3598
|
|
|
|
|
|
|
_overload_atan2 (a, b, third) |
3599
|
|
|
|
|
|
|
SV * a |
3600
|
|
|
|
|
|
|
SV * b |
3601
|
|
|
|
|
|
|
SV * third |
3602
|
|
|
|
|
|
|
CODE: |
3603
|
4
|
|
|
|
|
|
RETVAL = _overload_atan2 (aTHX_ a, b, third); |
3604
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3605
|
|
|
|
|
|
|
|
3606
|
|
|
|
|
|
|
SV * |
3607
|
|
|
|
|
|
|
_overload_inc (a, b, third) |
3608
|
|
|
|
|
|
|
SV * a |
3609
|
|
|
|
|
|
|
SV * b |
3610
|
|
|
|
|
|
|
SV * third |
3611
|
|
|
|
|
|
|
CODE: |
3612
|
1
|
|
|
|
|
|
RETVAL = _overload_inc (aTHX_ a, b, third); |
3613
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3614
|
|
|
|
|
|
|
|
3615
|
|
|
|
|
|
|
SV * |
3616
|
|
|
|
|
|
|
_overload_dec (a, b, third) |
3617
|
|
|
|
|
|
|
SV * a |
3618
|
|
|
|
|
|
|
SV * b |
3619
|
|
|
|
|
|
|
SV * third |
3620
|
|
|
|
|
|
|
CODE: |
3621
|
1
|
|
|
|
|
|
RETVAL = _overload_dec (aTHX_ a, b, third); |
3622
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3623
|
|
|
|
|
|
|
|
3624
|
|
|
|
|
|
|
SV * |
3625
|
|
|
|
|
|
|
_overload_pow (a, b, third) |
3626
|
|
|
|
|
|
|
SV * a |
3627
|
|
|
|
|
|
|
SV * b |
3628
|
|
|
|
|
|
|
SV * third |
3629
|
|
|
|
|
|
|
CODE: |
3630
|
16
|
|
|
|
|
|
RETVAL = _overload_pow (aTHX_ a, b, third); |
3631
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3632
|
|
|
|
|
|
|
|
3633
|
|
|
|
|
|
|
SV * |
3634
|
|
|
|
|
|
|
_overload_pow_eq (a, b, third) |
3635
|
|
|
|
|
|
|
SV * a |
3636
|
|
|
|
|
|
|
SV * b |
3637
|
|
|
|
|
|
|
SV * third |
3638
|
|
|
|
|
|
|
CODE: |
3639
|
5
|
|
|
|
|
|
RETVAL = _overload_pow_eq (aTHX_ a, b, third); |
3640
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3641
|
|
|
|
|
|
|
|
3642
|
|
|
|
|
|
|
SV * |
3643
|
|
|
|
|
|
|
cmp2NV (flt128_obj, sv) |
3644
|
|
|
|
|
|
|
SV * flt128_obj |
3645
|
|
|
|
|
|
|
SV * sv |
3646
|
|
|
|
|
|
|
CODE: |
3647
|
71
|
|
|
|
|
|
RETVAL = cmp2NV (aTHX_ flt128_obj, sv); |
3648
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3649
|
|
|
|
|
|
|
|
3650
|
|
|
|
|
|
|
SV * |
3651
|
|
|
|
|
|
|
F128toNV (f) |
3652
|
|
|
|
|
|
|
SV * f |
3653
|
|
|
|
|
|
|
CODE: |
3654
|
52
|
|
|
|
|
|
RETVAL = F128toNV (aTHX_ f); |
3655
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3656
|
|
|
|
|
|
|
|
3657
|
|
|
|
|
|
|
SV * |
3658
|
|
|
|
|
|
|
_FLT128_MAX () |
3659
|
|
|
|
|
|
|
CODE: |
3660
|
1
|
|
|
|
|
|
RETVAL = _FLT128_MAX (aTHX); |
3661
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3662
|
|
|
|
|
|
|
|
3663
|
|
|
|
|
|
|
|
3664
|
|
|
|
|
|
|
SV * |
3665
|
|
|
|
|
|
|
_FLT128_MIN () |
3666
|
|
|
|
|
|
|
CODE: |
3667
|
1
|
|
|
|
|
|
RETVAL = _FLT128_MIN (aTHX); |
3668
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3669
|
|
|
|
|
|
|
|
3670
|
|
|
|
|
|
|
|
3671
|
|
|
|
|
|
|
SV * |
3672
|
|
|
|
|
|
|
_FLT128_EPSILON () |
3673
|
|
|
|
|
|
|
CODE: |
3674
|
1
|
|
|
|
|
|
RETVAL = _FLT128_EPSILON (aTHX); |
3675
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3676
|
|
|
|
|
|
|
|
3677
|
|
|
|
|
|
|
|
3678
|
|
|
|
|
|
|
SV * |
3679
|
|
|
|
|
|
|
_FLT128_DENORM_MIN () |
3680
|
|
|
|
|
|
|
CODE: |
3681
|
1
|
|
|
|
|
|
RETVAL = _FLT128_DENORM_MIN (aTHX); |
3682
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3683
|
|
|
|
|
|
|
|
3684
|
|
|
|
|
|
|
|
3685
|
|
|
|
|
|
|
int |
3686
|
|
|
|
|
|
|
_FLT128_MANT_DIG () |
3687
|
|
|
|
|
|
|
|
3688
|
|
|
|
|
|
|
|
3689
|
|
|
|
|
|
|
int |
3690
|
|
|
|
|
|
|
_FLT128_MIN_EXP () |
3691
|
|
|
|
|
|
|
|
3692
|
|
|
|
|
|
|
|
3693
|
|
|
|
|
|
|
int |
3694
|
|
|
|
|
|
|
_FLT128_MAX_EXP () |
3695
|
|
|
|
|
|
|
|
3696
|
|
|
|
|
|
|
|
3697
|
|
|
|
|
|
|
int |
3698
|
|
|
|
|
|
|
_FLT128_MIN_10_EXP () |
3699
|
|
|
|
|
|
|
|
3700
|
|
|
|
|
|
|
|
3701
|
|
|
|
|
|
|
int |
3702
|
|
|
|
|
|
|
_FLT128_MAX_10_EXP () |
3703
|
|
|
|
|
|
|
|
3704
|
|
|
|
|
|
|
|
3705
|
|
|
|
|
|
|
SV * |
3706
|
|
|
|
|
|
|
_M_Eq () |
3707
|
|
|
|
|
|
|
CODE: |
3708
|
1
|
|
|
|
|
|
RETVAL = _M_Eq (aTHX); |
3709
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3710
|
|
|
|
|
|
|
|
3711
|
|
|
|
|
|
|
|
3712
|
|
|
|
|
|
|
SV * |
3713
|
|
|
|
|
|
|
_M_LOG2Eq () |
3714
|
|
|
|
|
|
|
CODE: |
3715
|
1
|
|
|
|
|
|
RETVAL = _M_LOG2Eq (aTHX); |
3716
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3717
|
|
|
|
|
|
|
|
3718
|
|
|
|
|
|
|
|
3719
|
|
|
|
|
|
|
SV * |
3720
|
|
|
|
|
|
|
_M_LOG10Eq () |
3721
|
|
|
|
|
|
|
CODE: |
3722
|
1
|
|
|
|
|
|
RETVAL = _M_LOG10Eq (aTHX); |
3723
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3724
|
|
|
|
|
|
|
|
3725
|
|
|
|
|
|
|
|
3726
|
|
|
|
|
|
|
SV * |
3727
|
|
|
|
|
|
|
_M_LN2q () |
3728
|
|
|
|
|
|
|
CODE: |
3729
|
1
|
|
|
|
|
|
RETVAL = _M_LN2q (aTHX); |
3730
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3731
|
|
|
|
|
|
|
|
3732
|
|
|
|
|
|
|
|
3733
|
|
|
|
|
|
|
SV * |
3734
|
|
|
|
|
|
|
_M_LN10q () |
3735
|
|
|
|
|
|
|
CODE: |
3736
|
1
|
|
|
|
|
|
RETVAL = _M_LN10q (aTHX); |
3737
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3738
|
|
|
|
|
|
|
|
3739
|
|
|
|
|
|
|
|
3740
|
|
|
|
|
|
|
SV * |
3741
|
|
|
|
|
|
|
_M_PIq () |
3742
|
|
|
|
|
|
|
CODE: |
3743
|
1
|
|
|
|
|
|
RETVAL = _M_PIq (aTHX); |
3744
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3745
|
|
|
|
|
|
|
|
3746
|
|
|
|
|
|
|
|
3747
|
|
|
|
|
|
|
SV * |
3748
|
|
|
|
|
|
|
_M_PI_2q () |
3749
|
|
|
|
|
|
|
CODE: |
3750
|
1
|
|
|
|
|
|
RETVAL = _M_PI_2q (aTHX); |
3751
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3752
|
|
|
|
|
|
|
|
3753
|
|
|
|
|
|
|
|
3754
|
|
|
|
|
|
|
SV * |
3755
|
|
|
|
|
|
|
_M_PI_4q () |
3756
|
|
|
|
|
|
|
CODE: |
3757
|
1
|
|
|
|
|
|
RETVAL = _M_PI_4q (aTHX); |
3758
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3759
|
|
|
|
|
|
|
|
3760
|
|
|
|
|
|
|
|
3761
|
|
|
|
|
|
|
SV * |
3762
|
|
|
|
|
|
|
_M_1_PIq () |
3763
|
|
|
|
|
|
|
CODE: |
3764
|
1
|
|
|
|
|
|
RETVAL = _M_1_PIq (aTHX); |
3765
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3766
|
|
|
|
|
|
|
|
3767
|
|
|
|
|
|
|
|
3768
|
|
|
|
|
|
|
SV * |
3769
|
|
|
|
|
|
|
_M_2_PIq () |
3770
|
|
|
|
|
|
|
CODE: |
3771
|
1
|
|
|
|
|
|
RETVAL = _M_2_PIq (aTHX); |
3772
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3773
|
|
|
|
|
|
|
|
3774
|
|
|
|
|
|
|
|
3775
|
|
|
|
|
|
|
SV * |
3776
|
|
|
|
|
|
|
_M_2_SQRTPIq () |
3777
|
|
|
|
|
|
|
CODE: |
3778
|
1
|
|
|
|
|
|
RETVAL = _M_2_SQRTPIq (aTHX); |
3779
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3780
|
|
|
|
|
|
|
|
3781
|
|
|
|
|
|
|
|
3782
|
|
|
|
|
|
|
SV * |
3783
|
|
|
|
|
|
|
_M_SQRT2q () |
3784
|
|
|
|
|
|
|
CODE: |
3785
|
1
|
|
|
|
|
|
RETVAL = _M_SQRT2q (aTHX); |
3786
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3787
|
|
|
|
|
|
|
|
3788
|
|
|
|
|
|
|
|
3789
|
|
|
|
|
|
|
SV * |
3790
|
|
|
|
|
|
|
_M_SQRT1_2q () |
3791
|
|
|
|
|
|
|
CODE: |
3792
|
1
|
|
|
|
|
|
RETVAL = _M_SQRT1_2q (aTHX); |
3793
|
|
|
|
|
|
|
OUTPUT: RETVAL |
3794
|
|
|
|
|
|
|
|
3795
|
|
|
|
|
|
|
|
3796
|
|
|
|
|
|
|
void |
3797
|
|
|
|
|
|
|
_f128_bytes (sv) |
3798
|
|
|
|
|
|
|
SV * sv |
3799
|
|
|
|
|
|
|
PREINIT: |
3800
|
|
|
|
|
|
|
I32* temp; |
3801
|
|
|
|
|
|
|
PPCODE: |
3802
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3803
|
1
|
|
|
|
|
|
_f128_bytes(aTHX_ sv); |
3804
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3805
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3806
|
0
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3807
|
0
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3808
|
|
|
|
|
|
|
} |
3809
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3810
|
1
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3811
|
|
|
|
|
|
|
|
3812
|
|
|
|
|
|
|
void |
3813
|
|
|
|
|
|
|
acos_F128 (rop, op) |
3814
|
|
|
|
|
|
|
float128 * rop |
3815
|
|
|
|
|
|
|
float128 * op |
3816
|
|
|
|
|
|
|
PREINIT: |
3817
|
|
|
|
|
|
|
I32* temp; |
3818
|
|
|
|
|
|
|
PPCODE: |
3819
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3820
|
1
|
|
|
|
|
|
acos_F128(rop, op); |
3821
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3822
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3823
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3824
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3825
|
|
|
|
|
|
|
} |
3826
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3827
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3828
|
|
|
|
|
|
|
|
3829
|
|
|
|
|
|
|
void |
3830
|
|
|
|
|
|
|
acosh_F128 (rop, op) |
3831
|
|
|
|
|
|
|
float128 * rop |
3832
|
|
|
|
|
|
|
float128 * op |
3833
|
|
|
|
|
|
|
PREINIT: |
3834
|
|
|
|
|
|
|
I32* temp; |
3835
|
|
|
|
|
|
|
PPCODE: |
3836
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3837
|
1
|
|
|
|
|
|
acosh_F128(rop, op); |
3838
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3839
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3840
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3841
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3842
|
|
|
|
|
|
|
} |
3843
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3844
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3845
|
|
|
|
|
|
|
|
3846
|
|
|
|
|
|
|
void |
3847
|
|
|
|
|
|
|
asin_F128 (rop, op) |
3848
|
|
|
|
|
|
|
float128 * rop |
3849
|
|
|
|
|
|
|
float128 * op |
3850
|
|
|
|
|
|
|
PREINIT: |
3851
|
|
|
|
|
|
|
I32* temp; |
3852
|
|
|
|
|
|
|
PPCODE: |
3853
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3854
|
1
|
|
|
|
|
|
asin_F128(rop, op); |
3855
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3856
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3857
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3858
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3859
|
|
|
|
|
|
|
} |
3860
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3861
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3862
|
|
|
|
|
|
|
|
3863
|
|
|
|
|
|
|
void |
3864
|
|
|
|
|
|
|
asinh_F128 (rop, op) |
3865
|
|
|
|
|
|
|
float128 * rop |
3866
|
|
|
|
|
|
|
float128 * op |
3867
|
|
|
|
|
|
|
PREINIT: |
3868
|
|
|
|
|
|
|
I32* temp; |
3869
|
|
|
|
|
|
|
PPCODE: |
3870
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3871
|
1
|
|
|
|
|
|
asinh_F128(rop, op); |
3872
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3873
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3874
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3875
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3876
|
|
|
|
|
|
|
} |
3877
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3878
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3879
|
|
|
|
|
|
|
|
3880
|
|
|
|
|
|
|
void |
3881
|
|
|
|
|
|
|
atan_F128 (rop, op) |
3882
|
|
|
|
|
|
|
float128 * rop |
3883
|
|
|
|
|
|
|
float128 * op |
3884
|
|
|
|
|
|
|
PREINIT: |
3885
|
|
|
|
|
|
|
I32* temp; |
3886
|
|
|
|
|
|
|
PPCODE: |
3887
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3888
|
1
|
|
|
|
|
|
atan_F128(rop, op); |
3889
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3890
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3891
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3892
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3893
|
|
|
|
|
|
|
} |
3894
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3895
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3896
|
|
|
|
|
|
|
|
3897
|
|
|
|
|
|
|
void |
3898
|
|
|
|
|
|
|
atanh_F128 (rop, op) |
3899
|
|
|
|
|
|
|
float128 * rop |
3900
|
|
|
|
|
|
|
float128 * op |
3901
|
|
|
|
|
|
|
PREINIT: |
3902
|
|
|
|
|
|
|
I32* temp; |
3903
|
|
|
|
|
|
|
PPCODE: |
3904
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3905
|
1
|
|
|
|
|
|
atanh_F128(rop, op); |
3906
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3907
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3908
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3909
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3910
|
|
|
|
|
|
|
} |
3911
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3912
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3913
|
|
|
|
|
|
|
|
3914
|
|
|
|
|
|
|
void |
3915
|
|
|
|
|
|
|
atan2_F128 (rop, op1, op2) |
3916
|
|
|
|
|
|
|
float128 * rop |
3917
|
|
|
|
|
|
|
float128 * op1 |
3918
|
|
|
|
|
|
|
float128 * op2 |
3919
|
|
|
|
|
|
|
PREINIT: |
3920
|
|
|
|
|
|
|
I32* temp; |
3921
|
|
|
|
|
|
|
PPCODE: |
3922
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3923
|
1
|
|
|
|
|
|
atan2_F128(rop, op1, op2); |
3924
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3925
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3926
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3927
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3928
|
|
|
|
|
|
|
} |
3929
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3930
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3931
|
|
|
|
|
|
|
|
3932
|
|
|
|
|
|
|
void |
3933
|
|
|
|
|
|
|
cbrt_F128 (rop, op) |
3934
|
|
|
|
|
|
|
float128 * rop |
3935
|
|
|
|
|
|
|
float128 * op |
3936
|
|
|
|
|
|
|
PREINIT: |
3937
|
|
|
|
|
|
|
I32* temp; |
3938
|
|
|
|
|
|
|
PPCODE: |
3939
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3940
|
1
|
|
|
|
|
|
cbrt_F128(rop, op); |
3941
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3942
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3943
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3944
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3945
|
|
|
|
|
|
|
} |
3946
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3947
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3948
|
|
|
|
|
|
|
|
3949
|
|
|
|
|
|
|
void |
3950
|
|
|
|
|
|
|
ceil_F128 (rop, op) |
3951
|
|
|
|
|
|
|
float128 * rop |
3952
|
|
|
|
|
|
|
float128 * op |
3953
|
|
|
|
|
|
|
PREINIT: |
3954
|
|
|
|
|
|
|
I32* temp; |
3955
|
|
|
|
|
|
|
PPCODE: |
3956
|
2
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3957
|
2
|
|
|
|
|
|
ceil_F128(rop, op); |
3958
|
2
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3959
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3960
|
2
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3961
|
2
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3962
|
|
|
|
|
|
|
} |
3963
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3964
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3965
|
|
|
|
|
|
|
|
3966
|
|
|
|
|
|
|
void |
3967
|
|
|
|
|
|
|
copysign_F128 (rop, op1, op2) |
3968
|
|
|
|
|
|
|
float128 * rop |
3969
|
|
|
|
|
|
|
float128 * op1 |
3970
|
|
|
|
|
|
|
float128 * op2 |
3971
|
|
|
|
|
|
|
PREINIT: |
3972
|
|
|
|
|
|
|
I32* temp; |
3973
|
|
|
|
|
|
|
PPCODE: |
3974
|
4
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3975
|
4
|
|
|
|
|
|
copysign_F128(rop, op1, op2); |
3976
|
4
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3977
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3978
|
4
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3979
|
4
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3980
|
|
|
|
|
|
|
} |
3981
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3982
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
3983
|
|
|
|
|
|
|
|
3984
|
|
|
|
|
|
|
void |
3985
|
|
|
|
|
|
|
cosh_F128 (rop, op) |
3986
|
|
|
|
|
|
|
float128 * rop |
3987
|
|
|
|
|
|
|
float128 * op |
3988
|
|
|
|
|
|
|
PREINIT: |
3989
|
|
|
|
|
|
|
I32* temp; |
3990
|
|
|
|
|
|
|
PPCODE: |
3991
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
3992
|
1
|
|
|
|
|
|
cosh_F128(rop, op); |
3993
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
3994
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
3995
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
3996
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
3997
|
|
|
|
|
|
|
} |
3998
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
3999
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4000
|
|
|
|
|
|
|
|
4001
|
|
|
|
|
|
|
void |
4002
|
|
|
|
|
|
|
cos_F128 (rop, op) |
4003
|
|
|
|
|
|
|
float128 * rop |
4004
|
|
|
|
|
|
|
float128 * op |
4005
|
|
|
|
|
|
|
PREINIT: |
4006
|
|
|
|
|
|
|
I32* temp; |
4007
|
|
|
|
|
|
|
PPCODE: |
4008
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4009
|
1
|
|
|
|
|
|
cos_F128(rop, op); |
4010
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4011
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4012
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4013
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4014
|
|
|
|
|
|
|
} |
4015
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4016
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4017
|
|
|
|
|
|
|
|
4018
|
|
|
|
|
|
|
void |
4019
|
|
|
|
|
|
|
erf_F128 (rop, op) |
4020
|
|
|
|
|
|
|
float128 * rop |
4021
|
|
|
|
|
|
|
float128 * op |
4022
|
|
|
|
|
|
|
PREINIT: |
4023
|
|
|
|
|
|
|
I32* temp; |
4024
|
|
|
|
|
|
|
PPCODE: |
4025
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4026
|
1
|
|
|
|
|
|
erf_F128(rop, op); |
4027
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4028
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4029
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4030
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4031
|
|
|
|
|
|
|
} |
4032
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4033
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4034
|
|
|
|
|
|
|
|
4035
|
|
|
|
|
|
|
void |
4036
|
|
|
|
|
|
|
erfc_F128 (rop, op) |
4037
|
|
|
|
|
|
|
float128 * rop |
4038
|
|
|
|
|
|
|
float128 * op |
4039
|
|
|
|
|
|
|
PREINIT: |
4040
|
|
|
|
|
|
|
I32* temp; |
4041
|
|
|
|
|
|
|
PPCODE: |
4042
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4043
|
1
|
|
|
|
|
|
erfc_F128(rop, op); |
4044
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4045
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4046
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4047
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4048
|
|
|
|
|
|
|
} |
4049
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4050
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4051
|
|
|
|
|
|
|
|
4052
|
|
|
|
|
|
|
void |
4053
|
|
|
|
|
|
|
exp_F128 (rop, op) |
4054
|
|
|
|
|
|
|
float128 * rop |
4055
|
|
|
|
|
|
|
float128 * op |
4056
|
|
|
|
|
|
|
PREINIT: |
4057
|
|
|
|
|
|
|
I32* temp; |
4058
|
|
|
|
|
|
|
PPCODE: |
4059
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4060
|
1
|
|
|
|
|
|
exp_F128(rop, op); |
4061
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4062
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4063
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4064
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4065
|
|
|
|
|
|
|
} |
4066
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4067
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4068
|
|
|
|
|
|
|
|
4069
|
|
|
|
|
|
|
void |
4070
|
|
|
|
|
|
|
expm1_F128 (rop, op) |
4071
|
|
|
|
|
|
|
float128 * rop |
4072
|
|
|
|
|
|
|
float128 * op |
4073
|
|
|
|
|
|
|
PREINIT: |
4074
|
|
|
|
|
|
|
I32* temp; |
4075
|
|
|
|
|
|
|
PPCODE: |
4076
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4077
|
1
|
|
|
|
|
|
expm1_F128(rop, op); |
4078
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4079
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4080
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4081
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4082
|
|
|
|
|
|
|
} |
4083
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4084
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4085
|
|
|
|
|
|
|
|
4086
|
|
|
|
|
|
|
void |
4087
|
|
|
|
|
|
|
fabs_F128 (rop, op) |
4088
|
|
|
|
|
|
|
float128 * rop |
4089
|
|
|
|
|
|
|
float128 * op |
4090
|
|
|
|
|
|
|
PREINIT: |
4091
|
|
|
|
|
|
|
I32* temp; |
4092
|
|
|
|
|
|
|
PPCODE: |
4093
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4094
|
1
|
|
|
|
|
|
fabs_F128(rop, op); |
4095
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4096
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4097
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4098
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4099
|
|
|
|
|
|
|
} |
4100
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4101
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4102
|
|
|
|
|
|
|
|
4103
|
|
|
|
|
|
|
void |
4104
|
|
|
|
|
|
|
fdim_F128 (rop, op1, op2) |
4105
|
|
|
|
|
|
|
float128 * rop |
4106
|
|
|
|
|
|
|
float128 * op1 |
4107
|
|
|
|
|
|
|
float128 * op2 |
4108
|
|
|
|
|
|
|
PREINIT: |
4109
|
|
|
|
|
|
|
I32* temp; |
4110
|
|
|
|
|
|
|
PPCODE: |
4111
|
2
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4112
|
2
|
|
|
|
|
|
fdim_F128(rop, op1, op2); |
4113
|
2
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4114
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4115
|
2
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4116
|
2
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4117
|
|
|
|
|
|
|
} |
4118
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4119
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4120
|
|
|
|
|
|
|
|
4121
|
|
|
|
|
|
|
int |
4122
|
|
|
|
|
|
|
finite_F128 (op) |
4123
|
|
|
|
|
|
|
float128 * op |
4124
|
|
|
|
|
|
|
|
4125
|
|
|
|
|
|
|
void |
4126
|
|
|
|
|
|
|
floor_F128 (rop, op) |
4127
|
|
|
|
|
|
|
float128 * rop |
4128
|
|
|
|
|
|
|
float128 * op |
4129
|
|
|
|
|
|
|
PREINIT: |
4130
|
|
|
|
|
|
|
I32* temp; |
4131
|
|
|
|
|
|
|
PPCODE: |
4132
|
2
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4133
|
2
|
|
|
|
|
|
floor_F128(rop, op); |
4134
|
2
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4135
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4136
|
2
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4137
|
2
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4138
|
|
|
|
|
|
|
} |
4139
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4140
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4141
|
|
|
|
|
|
|
|
4142
|
|
|
|
|
|
|
void |
4143
|
|
|
|
|
|
|
fma_F128 (rop, op1, op2, op3) |
4144
|
|
|
|
|
|
|
float128 * rop |
4145
|
|
|
|
|
|
|
float128 * op1 |
4146
|
|
|
|
|
|
|
float128 * op2 |
4147
|
|
|
|
|
|
|
float128 * op3 |
4148
|
|
|
|
|
|
|
PREINIT: |
4149
|
|
|
|
|
|
|
I32* temp; |
4150
|
|
|
|
|
|
|
PPCODE: |
4151
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4152
|
1
|
|
|
|
|
|
fma_F128(rop, op1, op2, op3); |
4153
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4154
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4155
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4156
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4157
|
|
|
|
|
|
|
} |
4158
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4159
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4160
|
|
|
|
|
|
|
|
4161
|
|
|
|
|
|
|
void |
4162
|
|
|
|
|
|
|
fmax_F128 (rop, op1, op2) |
4163
|
|
|
|
|
|
|
float128 * rop |
4164
|
|
|
|
|
|
|
float128 * op1 |
4165
|
|
|
|
|
|
|
float128 * op2 |
4166
|
|
|
|
|
|
|
PREINIT: |
4167
|
|
|
|
|
|
|
I32* temp; |
4168
|
|
|
|
|
|
|
PPCODE: |
4169
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4170
|
1
|
|
|
|
|
|
fmax_F128(rop, op1, op2); |
4171
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4172
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4173
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4174
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4175
|
|
|
|
|
|
|
} |
4176
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4177
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4178
|
|
|
|
|
|
|
|
4179
|
|
|
|
|
|
|
void |
4180
|
|
|
|
|
|
|
fmin_F128 (rop, op1, op2) |
4181
|
|
|
|
|
|
|
float128 * rop |
4182
|
|
|
|
|
|
|
float128 * op1 |
4183
|
|
|
|
|
|
|
float128 * op2 |
4184
|
|
|
|
|
|
|
PREINIT: |
4185
|
|
|
|
|
|
|
I32* temp; |
4186
|
|
|
|
|
|
|
PPCODE: |
4187
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4188
|
1
|
|
|
|
|
|
fmin_F128(rop, op1, op2); |
4189
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4190
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4191
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4192
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4193
|
|
|
|
|
|
|
} |
4194
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4195
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4196
|
|
|
|
|
|
|
|
4197
|
|
|
|
|
|
|
void |
4198
|
|
|
|
|
|
|
fmod_F128 (rop, op1, op2) |
4199
|
|
|
|
|
|
|
float128 * rop |
4200
|
|
|
|
|
|
|
float128 * op1 |
4201
|
|
|
|
|
|
|
float128 * op2 |
4202
|
|
|
|
|
|
|
PREINIT: |
4203
|
|
|
|
|
|
|
I32* temp; |
4204
|
|
|
|
|
|
|
PPCODE: |
4205
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4206
|
1
|
|
|
|
|
|
fmod_F128(rop, op1, op2); |
4207
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4208
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4209
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4210
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4211
|
|
|
|
|
|
|
} |
4212
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4213
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4214
|
|
|
|
|
|
|
|
4215
|
|
|
|
|
|
|
void |
4216
|
|
|
|
|
|
|
hypot_F128 (rop, op1, op2) |
4217
|
|
|
|
|
|
|
float128 * rop |
4218
|
|
|
|
|
|
|
float128 * op1 |
4219
|
|
|
|
|
|
|
float128 * op2 |
4220
|
|
|
|
|
|
|
PREINIT: |
4221
|
|
|
|
|
|
|
I32* temp; |
4222
|
|
|
|
|
|
|
PPCODE: |
4223
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4224
|
1
|
|
|
|
|
|
hypot_F128(rop, op1, op2); |
4225
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4226
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4227
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4228
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4229
|
|
|
|
|
|
|
} |
4230
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4231
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4232
|
|
|
|
|
|
|
|
4233
|
|
|
|
|
|
|
void |
4234
|
|
|
|
|
|
|
frexp_F128 (frac, exp, op) |
4235
|
|
|
|
|
|
|
float128 * frac |
4236
|
|
|
|
|
|
|
SV * exp |
4237
|
|
|
|
|
|
|
float128 * op |
4238
|
|
|
|
|
|
|
PREINIT: |
4239
|
|
|
|
|
|
|
I32* temp; |
4240
|
|
|
|
|
|
|
PPCODE: |
4241
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4242
|
1
|
|
|
|
|
|
frexp_F128(aTHX_ frac, exp, op); |
4243
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4244
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4245
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4246
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4247
|
|
|
|
|
|
|
} |
4248
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4249
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4250
|
|
|
|
|
|
|
|
4251
|
|
|
|
|
|
|
void |
4252
|
|
|
|
|
|
|
ldexp_F128 (rop, op, pow) |
4253
|
|
|
|
|
|
|
float128 * rop |
4254
|
|
|
|
|
|
|
float128 * op |
4255
|
|
|
|
|
|
|
int pow |
4256
|
|
|
|
|
|
|
PREINIT: |
4257
|
|
|
|
|
|
|
I32* temp; |
4258
|
|
|
|
|
|
|
PPCODE: |
4259
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4260
|
1
|
|
|
|
|
|
ldexp_F128(rop, op, pow); |
4261
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4262
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4263
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4264
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4265
|
|
|
|
|
|
|
} |
4266
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4267
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4268
|
|
|
|
|
|
|
|
4269
|
|
|
|
|
|
|
int |
4270
|
|
|
|
|
|
|
isinf_F128 (op) |
4271
|
|
|
|
|
|
|
float128 * op |
4272
|
|
|
|
|
|
|
|
4273
|
|
|
|
|
|
|
int |
4274
|
|
|
|
|
|
|
ilogb_F128 (op) |
4275
|
|
|
|
|
|
|
float128 * op |
4276
|
|
|
|
|
|
|
|
4277
|
|
|
|
|
|
|
int |
4278
|
|
|
|
|
|
|
isnan_F128 (op) |
4279
|
|
|
|
|
|
|
float128 * op |
4280
|
|
|
|
|
|
|
|
4281
|
|
|
|
|
|
|
void |
4282
|
|
|
|
|
|
|
j0_F128 (rop, op) |
4283
|
|
|
|
|
|
|
float128 * rop |
4284
|
|
|
|
|
|
|
float128 * op |
4285
|
|
|
|
|
|
|
PREINIT: |
4286
|
|
|
|
|
|
|
I32* temp; |
4287
|
|
|
|
|
|
|
PPCODE: |
4288
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4289
|
1
|
|
|
|
|
|
j0_F128(rop, op); |
4290
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4291
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4292
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4293
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4294
|
|
|
|
|
|
|
} |
4295
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4296
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4297
|
|
|
|
|
|
|
|
4298
|
|
|
|
|
|
|
void |
4299
|
|
|
|
|
|
|
j1_F128 (rop, op) |
4300
|
|
|
|
|
|
|
float128 * rop |
4301
|
|
|
|
|
|
|
float128 * op |
4302
|
|
|
|
|
|
|
PREINIT: |
4303
|
|
|
|
|
|
|
I32* temp; |
4304
|
|
|
|
|
|
|
PPCODE: |
4305
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4306
|
1
|
|
|
|
|
|
j1_F128(rop, op); |
4307
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4308
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4309
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4310
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4311
|
|
|
|
|
|
|
} |
4312
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4313
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4314
|
|
|
|
|
|
|
|
4315
|
|
|
|
|
|
|
void |
4316
|
|
|
|
|
|
|
jn_F128 (rop, n, op) |
4317
|
|
|
|
|
|
|
float128 * rop |
4318
|
|
|
|
|
|
|
int n |
4319
|
|
|
|
|
|
|
float128 * op |
4320
|
|
|
|
|
|
|
PREINIT: |
4321
|
|
|
|
|
|
|
I32* temp; |
4322
|
|
|
|
|
|
|
PPCODE: |
4323
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4324
|
1
|
|
|
|
|
|
jn_F128(rop, n, op); |
4325
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4326
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4327
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4328
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4329
|
|
|
|
|
|
|
} |
4330
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4331
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4332
|
|
|
|
|
|
|
|
4333
|
|
|
|
|
|
|
void |
4334
|
|
|
|
|
|
|
lgamma_F128 (rop, op) |
4335
|
|
|
|
|
|
|
float128 * rop |
4336
|
|
|
|
|
|
|
float128 * op |
4337
|
|
|
|
|
|
|
PREINIT: |
4338
|
|
|
|
|
|
|
I32* temp; |
4339
|
|
|
|
|
|
|
PPCODE: |
4340
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4341
|
1
|
|
|
|
|
|
lgamma_F128(rop, op); |
4342
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4343
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4344
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4345
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4346
|
|
|
|
|
|
|
} |
4347
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4348
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4349
|
|
|
|
|
|
|
|
4350
|
|
|
|
|
|
|
SV * |
4351
|
|
|
|
|
|
|
llrint_F128 (op) |
4352
|
|
|
|
|
|
|
float128 * op |
4353
|
|
|
|
|
|
|
CODE: |
4354
|
2
|
|
|
|
|
|
RETVAL = llrint_F128 (aTHX_ op); |
4355
|
|
|
|
|
|
|
OUTPUT: RETVAL |
4356
|
|
|
|
|
|
|
|
4357
|
|
|
|
|
|
|
SV * |
4358
|
|
|
|
|
|
|
llround_F128 (op) |
4359
|
|
|
|
|
|
|
float128 * op |
4360
|
|
|
|
|
|
|
CODE: |
4361
|
2
|
|
|
|
|
|
RETVAL = llround_F128 (aTHX_ op); |
4362
|
|
|
|
|
|
|
OUTPUT: RETVAL |
4363
|
|
|
|
|
|
|
|
4364
|
|
|
|
|
|
|
SV * |
4365
|
|
|
|
|
|
|
lrint_F128 (op) |
4366
|
|
|
|
|
|
|
float128 * op |
4367
|
|
|
|
|
|
|
CODE: |
4368
|
2
|
|
|
|
|
|
RETVAL = lrint_F128 (aTHX_ op); |
4369
|
|
|
|
|
|
|
OUTPUT: RETVAL |
4370
|
|
|
|
|
|
|
|
4371
|
|
|
|
|
|
|
SV * |
4372
|
|
|
|
|
|
|
lround_F128 (op) |
4373
|
|
|
|
|
|
|
float128 * op |
4374
|
|
|
|
|
|
|
CODE: |
4375
|
2
|
|
|
|
|
|
RETVAL = lround_F128 (aTHX_ op); |
4376
|
|
|
|
|
|
|
OUTPUT: RETVAL |
4377
|
|
|
|
|
|
|
|
4378
|
|
|
|
|
|
|
void |
4379
|
|
|
|
|
|
|
log_F128 (rop, op) |
4380
|
|
|
|
|
|
|
float128 * rop |
4381
|
|
|
|
|
|
|
float128 * op |
4382
|
|
|
|
|
|
|
PREINIT: |
4383
|
|
|
|
|
|
|
I32* temp; |
4384
|
|
|
|
|
|
|
PPCODE: |
4385
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4386
|
1
|
|
|
|
|
|
log_F128(rop, op); |
4387
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4388
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4389
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4390
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4391
|
|
|
|
|
|
|
} |
4392
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4393
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4394
|
|
|
|
|
|
|
|
4395
|
|
|
|
|
|
|
void |
4396
|
|
|
|
|
|
|
log10_F128 (rop, op) |
4397
|
|
|
|
|
|
|
float128 * rop |
4398
|
|
|
|
|
|
|
float128 * op |
4399
|
|
|
|
|
|
|
PREINIT: |
4400
|
|
|
|
|
|
|
I32* temp; |
4401
|
|
|
|
|
|
|
PPCODE: |
4402
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4403
|
1
|
|
|
|
|
|
log10_F128(rop, op); |
4404
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4405
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4406
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4407
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4408
|
|
|
|
|
|
|
} |
4409
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4410
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4411
|
|
|
|
|
|
|
|
4412
|
|
|
|
|
|
|
void |
4413
|
|
|
|
|
|
|
log2_F128 (rop, op) |
4414
|
|
|
|
|
|
|
float128 * rop |
4415
|
|
|
|
|
|
|
float128 * op |
4416
|
|
|
|
|
|
|
PREINIT: |
4417
|
|
|
|
|
|
|
I32* temp; |
4418
|
|
|
|
|
|
|
PPCODE: |
4419
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4420
|
1
|
|
|
|
|
|
log2_F128(rop, op); |
4421
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4422
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4423
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4424
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4425
|
|
|
|
|
|
|
} |
4426
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4427
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4428
|
|
|
|
|
|
|
|
4429
|
|
|
|
|
|
|
void |
4430
|
|
|
|
|
|
|
log1p_F128 (rop, op) |
4431
|
|
|
|
|
|
|
float128 * rop |
4432
|
|
|
|
|
|
|
float128 * op |
4433
|
|
|
|
|
|
|
PREINIT: |
4434
|
|
|
|
|
|
|
I32* temp; |
4435
|
|
|
|
|
|
|
PPCODE: |
4436
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4437
|
1
|
|
|
|
|
|
log1p_F128(rop, op); |
4438
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4439
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4440
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4441
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4442
|
|
|
|
|
|
|
} |
4443
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4444
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4445
|
|
|
|
|
|
|
|
4446
|
|
|
|
|
|
|
void |
4447
|
|
|
|
|
|
|
modf_F128 (integer, frac, op) |
4448
|
|
|
|
|
|
|
float128 * integer |
4449
|
|
|
|
|
|
|
float128 * frac |
4450
|
|
|
|
|
|
|
float128 * op |
4451
|
|
|
|
|
|
|
PREINIT: |
4452
|
|
|
|
|
|
|
I32* temp; |
4453
|
|
|
|
|
|
|
PPCODE: |
4454
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4455
|
1
|
|
|
|
|
|
modf_F128(integer, frac, op); |
4456
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4457
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4458
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4459
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4460
|
|
|
|
|
|
|
} |
4461
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4462
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4463
|
|
|
|
|
|
|
|
4464
|
|
|
|
|
|
|
void |
4465
|
|
|
|
|
|
|
nan_F128 (rop, op) |
4466
|
|
|
|
|
|
|
float128 * rop |
4467
|
|
|
|
|
|
|
SV * op |
4468
|
|
|
|
|
|
|
PREINIT: |
4469
|
|
|
|
|
|
|
I32* temp; |
4470
|
|
|
|
|
|
|
PPCODE: |
4471
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4472
|
1
|
|
|
|
|
|
nan_F128(aTHX_ rop, op); |
4473
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4474
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4475
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4476
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4477
|
|
|
|
|
|
|
} |
4478
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4479
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4480
|
|
|
|
|
|
|
|
4481
|
|
|
|
|
|
|
void |
4482
|
|
|
|
|
|
|
nearbyint_F128 (rop, op) |
4483
|
|
|
|
|
|
|
float128 * rop |
4484
|
|
|
|
|
|
|
float128 * op |
4485
|
|
|
|
|
|
|
PREINIT: |
4486
|
|
|
|
|
|
|
I32* temp; |
4487
|
|
|
|
|
|
|
PPCODE: |
4488
|
6
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4489
|
6
|
|
|
|
|
|
nearbyint_F128(rop, op); |
4490
|
6
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4491
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4492
|
6
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4493
|
6
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4494
|
|
|
|
|
|
|
} |
4495
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4496
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4497
|
|
|
|
|
|
|
|
4498
|
|
|
|
|
|
|
void |
4499
|
|
|
|
|
|
|
nextafter_F128 (rop, op1, op2) |
4500
|
|
|
|
|
|
|
float128 * rop |
4501
|
|
|
|
|
|
|
float128 * op1 |
4502
|
|
|
|
|
|
|
float128 * op2 |
4503
|
|
|
|
|
|
|
PREINIT: |
4504
|
|
|
|
|
|
|
I32* temp; |
4505
|
|
|
|
|
|
|
PPCODE: |
4506
|
2
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4507
|
2
|
|
|
|
|
|
nextafter_F128(rop, op1, op2); |
4508
|
2
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4509
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4510
|
2
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4511
|
2
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4512
|
|
|
|
|
|
|
} |
4513
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4514
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4515
|
|
|
|
|
|
|
|
4516
|
|
|
|
|
|
|
void |
4517
|
|
|
|
|
|
|
pow_F128 (rop, op1, op2) |
4518
|
|
|
|
|
|
|
float128 * rop |
4519
|
|
|
|
|
|
|
float128 * op1 |
4520
|
|
|
|
|
|
|
float128 * op2 |
4521
|
|
|
|
|
|
|
PREINIT: |
4522
|
|
|
|
|
|
|
I32* temp; |
4523
|
|
|
|
|
|
|
PPCODE: |
4524
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4525
|
1
|
|
|
|
|
|
pow_F128(rop, op1, op2); |
4526
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4527
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4528
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4529
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4530
|
|
|
|
|
|
|
} |
4531
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4532
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4533
|
|
|
|
|
|
|
|
4534
|
|
|
|
|
|
|
void |
4535
|
|
|
|
|
|
|
remainder_F128 (rop, op1, op2) |
4536
|
|
|
|
|
|
|
float128 * rop |
4537
|
|
|
|
|
|
|
float128 * op1 |
4538
|
|
|
|
|
|
|
float128 * op2 |
4539
|
|
|
|
|
|
|
PREINIT: |
4540
|
|
|
|
|
|
|
I32* temp; |
4541
|
|
|
|
|
|
|
PPCODE: |
4542
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4543
|
1
|
|
|
|
|
|
remainder_F128(rop, op1, op2); |
4544
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4545
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4546
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4547
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4548
|
|
|
|
|
|
|
} |
4549
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4550
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4551
|
|
|
|
|
|
|
|
4552
|
|
|
|
|
|
|
void |
4553
|
|
|
|
|
|
|
remquo_F128 (rop1, rop2, op1, op2) |
4554
|
|
|
|
|
|
|
float128 * rop1 |
4555
|
|
|
|
|
|
|
SV * rop2 |
4556
|
|
|
|
|
|
|
float128 * op1 |
4557
|
|
|
|
|
|
|
float128 * op2 |
4558
|
|
|
|
|
|
|
PREINIT: |
4559
|
|
|
|
|
|
|
I32* temp; |
4560
|
|
|
|
|
|
|
PPCODE: |
4561
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4562
|
1
|
|
|
|
|
|
remquo_F128(aTHX_ rop1, rop2, op1, op2); |
4563
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4564
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4565
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4566
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4567
|
|
|
|
|
|
|
} |
4568
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4569
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4570
|
|
|
|
|
|
|
|
4571
|
|
|
|
|
|
|
void |
4572
|
|
|
|
|
|
|
rint_F128 (rop, op) |
4573
|
|
|
|
|
|
|
float128 * rop |
4574
|
|
|
|
|
|
|
float128 * op |
4575
|
|
|
|
|
|
|
PREINIT: |
4576
|
|
|
|
|
|
|
I32* temp; |
4577
|
|
|
|
|
|
|
PPCODE: |
4578
|
2
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4579
|
2
|
|
|
|
|
|
rint_F128(rop, op); |
4580
|
2
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4581
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4582
|
2
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4583
|
2
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4584
|
|
|
|
|
|
|
} |
4585
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4586
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4587
|
|
|
|
|
|
|
|
4588
|
|
|
|
|
|
|
void |
4589
|
|
|
|
|
|
|
round_F128 (rop, op) |
4590
|
|
|
|
|
|
|
float128 * rop |
4591
|
|
|
|
|
|
|
float128 * op |
4592
|
|
|
|
|
|
|
PREINIT: |
4593
|
|
|
|
|
|
|
I32* temp; |
4594
|
|
|
|
|
|
|
PPCODE: |
4595
|
2
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4596
|
2
|
|
|
|
|
|
round_F128(rop, op); |
4597
|
2
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4598
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4599
|
2
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4600
|
2
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4601
|
|
|
|
|
|
|
} |
4602
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4603
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4604
|
|
|
|
|
|
|
|
4605
|
|
|
|
|
|
|
void |
4606
|
|
|
|
|
|
|
scalbln_F128 (rop, op1, op2) |
4607
|
|
|
|
|
|
|
float128 * rop |
4608
|
|
|
|
|
|
|
float128 * op1 |
4609
|
|
|
|
|
|
|
long op2 |
4610
|
|
|
|
|
|
|
PREINIT: |
4611
|
|
|
|
|
|
|
I32* temp; |
4612
|
|
|
|
|
|
|
PPCODE: |
4613
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4614
|
1
|
|
|
|
|
|
scalbln_F128(rop, op1, op2); |
4615
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4616
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4617
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4618
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4619
|
|
|
|
|
|
|
} |
4620
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4621
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4622
|
|
|
|
|
|
|
|
4623
|
|
|
|
|
|
|
void |
4624
|
|
|
|
|
|
|
scalbn_F128 (rop, op1, op2) |
4625
|
|
|
|
|
|
|
float128 * rop |
4626
|
|
|
|
|
|
|
float128 * op1 |
4627
|
|
|
|
|
|
|
int op2 |
4628
|
|
|
|
|
|
|
PREINIT: |
4629
|
|
|
|
|
|
|
I32* temp; |
4630
|
|
|
|
|
|
|
PPCODE: |
4631
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4632
|
1
|
|
|
|
|
|
scalbn_F128(rop, op1, op2); |
4633
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4634
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4635
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4636
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4637
|
|
|
|
|
|
|
} |
4638
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4639
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4640
|
|
|
|
|
|
|
|
4641
|
|
|
|
|
|
|
int |
4642
|
|
|
|
|
|
|
signbit_F128 (op) |
4643
|
|
|
|
|
|
|
float128 * op |
4644
|
|
|
|
|
|
|
|
4645
|
|
|
|
|
|
|
void |
4646
|
|
|
|
|
|
|
sincos_F128 (sin, cos, op) |
4647
|
|
|
|
|
|
|
float128 * sin |
4648
|
|
|
|
|
|
|
float128 * cos |
4649
|
|
|
|
|
|
|
float128 * op |
4650
|
|
|
|
|
|
|
PREINIT: |
4651
|
|
|
|
|
|
|
I32* temp; |
4652
|
|
|
|
|
|
|
PPCODE: |
4653
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4654
|
1
|
|
|
|
|
|
sincos_F128(sin, cos, op); |
4655
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4656
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4657
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4658
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4659
|
|
|
|
|
|
|
} |
4660
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4661
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4662
|
|
|
|
|
|
|
|
4663
|
|
|
|
|
|
|
void |
4664
|
|
|
|
|
|
|
sinh_F128 (rop, op) |
4665
|
|
|
|
|
|
|
float128 * rop |
4666
|
|
|
|
|
|
|
float128 * op |
4667
|
|
|
|
|
|
|
PREINIT: |
4668
|
|
|
|
|
|
|
I32* temp; |
4669
|
|
|
|
|
|
|
PPCODE: |
4670
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4671
|
1
|
|
|
|
|
|
sinh_F128(rop, op); |
4672
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4673
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4674
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4675
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4676
|
|
|
|
|
|
|
} |
4677
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4678
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4679
|
|
|
|
|
|
|
|
4680
|
|
|
|
|
|
|
void |
4681
|
|
|
|
|
|
|
sin_F128 (rop, op) |
4682
|
|
|
|
|
|
|
float128 * rop |
4683
|
|
|
|
|
|
|
float128 * op |
4684
|
|
|
|
|
|
|
PREINIT: |
4685
|
|
|
|
|
|
|
I32* temp; |
4686
|
|
|
|
|
|
|
PPCODE: |
4687
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4688
|
1
|
|
|
|
|
|
sin_F128(rop, op); |
4689
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4690
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4691
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4692
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4693
|
|
|
|
|
|
|
} |
4694
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4695
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4696
|
|
|
|
|
|
|
|
4697
|
|
|
|
|
|
|
void |
4698
|
|
|
|
|
|
|
sqrt_F128 (rop, op) |
4699
|
|
|
|
|
|
|
float128 * rop |
4700
|
|
|
|
|
|
|
float128 * op |
4701
|
|
|
|
|
|
|
PREINIT: |
4702
|
|
|
|
|
|
|
I32* temp; |
4703
|
|
|
|
|
|
|
PPCODE: |
4704
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4705
|
1
|
|
|
|
|
|
sqrt_F128(rop, op); |
4706
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4707
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4708
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4709
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4710
|
|
|
|
|
|
|
} |
4711
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4712
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4713
|
|
|
|
|
|
|
|
4714
|
|
|
|
|
|
|
void |
4715
|
|
|
|
|
|
|
tan_F128 (rop, op) |
4716
|
|
|
|
|
|
|
float128 * rop |
4717
|
|
|
|
|
|
|
float128 * op |
4718
|
|
|
|
|
|
|
PREINIT: |
4719
|
|
|
|
|
|
|
I32* temp; |
4720
|
|
|
|
|
|
|
PPCODE: |
4721
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4722
|
1
|
|
|
|
|
|
tan_F128(rop, op); |
4723
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4724
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4725
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4726
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4727
|
|
|
|
|
|
|
} |
4728
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4729
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4730
|
|
|
|
|
|
|
|
4731
|
|
|
|
|
|
|
void |
4732
|
|
|
|
|
|
|
tanh_F128 (rop, op) |
4733
|
|
|
|
|
|
|
float128 * rop |
4734
|
|
|
|
|
|
|
float128 * op |
4735
|
|
|
|
|
|
|
PREINIT: |
4736
|
|
|
|
|
|
|
I32* temp; |
4737
|
|
|
|
|
|
|
PPCODE: |
4738
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4739
|
1
|
|
|
|
|
|
tanh_F128(rop, op); |
4740
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4741
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4742
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4743
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4744
|
|
|
|
|
|
|
} |
4745
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4746
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4747
|
|
|
|
|
|
|
|
4748
|
|
|
|
|
|
|
void |
4749
|
|
|
|
|
|
|
tgamma_F128 (rop, op) |
4750
|
|
|
|
|
|
|
float128 * rop |
4751
|
|
|
|
|
|
|
float128 * op |
4752
|
|
|
|
|
|
|
PREINIT: |
4753
|
|
|
|
|
|
|
I32* temp; |
4754
|
|
|
|
|
|
|
PPCODE: |
4755
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4756
|
1
|
|
|
|
|
|
tgamma_F128(rop, op); |
4757
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4758
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4759
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4760
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4761
|
|
|
|
|
|
|
} |
4762
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4763
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4764
|
|
|
|
|
|
|
|
4765
|
|
|
|
|
|
|
void |
4766
|
|
|
|
|
|
|
trunc_F128 (rop, op) |
4767
|
|
|
|
|
|
|
float128 * rop |
4768
|
|
|
|
|
|
|
float128 * op |
4769
|
|
|
|
|
|
|
PREINIT: |
4770
|
|
|
|
|
|
|
I32* temp; |
4771
|
|
|
|
|
|
|
PPCODE: |
4772
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4773
|
1
|
|
|
|
|
|
trunc_F128(rop, op); |
4774
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4775
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4776
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4777
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4778
|
|
|
|
|
|
|
} |
4779
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4780
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4781
|
|
|
|
|
|
|
|
4782
|
|
|
|
|
|
|
void |
4783
|
|
|
|
|
|
|
y0_F128 (rop, op) |
4784
|
|
|
|
|
|
|
float128 * rop |
4785
|
|
|
|
|
|
|
float128 * op |
4786
|
|
|
|
|
|
|
PREINIT: |
4787
|
|
|
|
|
|
|
I32* temp; |
4788
|
|
|
|
|
|
|
PPCODE: |
4789
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4790
|
1
|
|
|
|
|
|
y0_F128(rop, op); |
4791
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4792
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4793
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4794
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4795
|
|
|
|
|
|
|
} |
4796
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4797
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4798
|
|
|
|
|
|
|
|
4799
|
|
|
|
|
|
|
void |
4800
|
|
|
|
|
|
|
y1_F128 (rop, op) |
4801
|
|
|
|
|
|
|
float128 * rop |
4802
|
|
|
|
|
|
|
float128 * op |
4803
|
|
|
|
|
|
|
PREINIT: |
4804
|
|
|
|
|
|
|
I32* temp; |
4805
|
|
|
|
|
|
|
PPCODE: |
4806
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4807
|
1
|
|
|
|
|
|
y1_F128(rop, op); |
4808
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4809
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4810
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4811
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4812
|
|
|
|
|
|
|
} |
4813
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4814
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4815
|
|
|
|
|
|
|
|
4816
|
|
|
|
|
|
|
void |
4817
|
|
|
|
|
|
|
yn_F128 (rop, n, op) |
4818
|
|
|
|
|
|
|
float128 * rop |
4819
|
|
|
|
|
|
|
int n |
4820
|
|
|
|
|
|
|
float128 * op |
4821
|
|
|
|
|
|
|
PREINIT: |
4822
|
|
|
|
|
|
|
I32* temp; |
4823
|
|
|
|
|
|
|
PPCODE: |
4824
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4825
|
1
|
|
|
|
|
|
yn_F128(rop, n, op); |
4826
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4827
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4828
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4829
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4830
|
|
|
|
|
|
|
} |
4831
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4832
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4833
|
|
|
|
|
|
|
|
4834
|
|
|
|
|
|
|
int |
4835
|
|
|
|
|
|
|
_longlong2iv_is_ok () |
4836
|
|
|
|
|
|
|
|
4837
|
|
|
|
|
|
|
|
4838
|
|
|
|
|
|
|
int |
4839
|
|
|
|
|
|
|
_long2iv_is_ok () |
4840
|
|
|
|
|
|
|
|
4841
|
|
|
|
|
|
|
|
4842
|
|
|
|
|
|
|
int |
4843
|
|
|
|
|
|
|
_flt_radix () |
4844
|
|
|
|
|
|
|
|
4845
|
|
|
|
|
|
|
|
4846
|
|
|
|
|
|
|
SV * |
4847
|
|
|
|
|
|
|
_fegetround () |
4848
|
|
|
|
|
|
|
CODE: |
4849
|
1
|
|
|
|
|
|
RETVAL = _fegetround (aTHX); |
4850
|
|
|
|
|
|
|
OUTPUT: RETVAL |
4851
|
|
|
|
|
|
|
|
4852
|
|
|
|
|
|
|
|
4853
|
|
|
|
|
|
|
int |
4854
|
|
|
|
|
|
|
nnumflag () |
4855
|
|
|
|
|
|
|
|
4856
|
|
|
|
|
|
|
|
4857
|
|
|
|
|
|
|
void |
4858
|
|
|
|
|
|
|
clear_nnum () |
4859
|
|
|
|
|
|
|
|
4860
|
|
|
|
|
|
|
PREINIT: |
4861
|
|
|
|
|
|
|
I32* temp; |
4862
|
|
|
|
|
|
|
PPCODE: |
4863
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4864
|
1
|
|
|
|
|
|
clear_nnum(); |
4865
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4866
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4867
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4868
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4869
|
|
|
|
|
|
|
} |
4870
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4871
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4872
|
|
|
|
|
|
|
|
4873
|
|
|
|
|
|
|
void |
4874
|
|
|
|
|
|
|
set_nnum (x) |
4875
|
|
|
|
|
|
|
int x |
4876
|
|
|
|
|
|
|
PREINIT: |
4877
|
|
|
|
|
|
|
I32* temp; |
4878
|
|
|
|
|
|
|
PPCODE: |
4879
|
1
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4880
|
1
|
|
|
|
|
|
set_nnum(x); |
4881
|
1
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4882
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4883
|
1
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4884
|
1
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4885
|
|
|
|
|
|
|
} |
4886
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4887
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4888
|
|
|
|
|
|
|
|
4889
|
|
|
|
|
|
|
int |
4890
|
|
|
|
|
|
|
_lln (x) |
4891
|
|
|
|
|
|
|
SV * x |
4892
|
|
|
|
|
|
|
CODE: |
4893
|
0
|
|
|
|
|
|
RETVAL = _lln (aTHX_ x); |
4894
|
|
|
|
|
|
|
OUTPUT: RETVAL |
4895
|
|
|
|
|
|
|
|
4896
|
|
|
|
|
|
|
int |
4897
|
|
|
|
|
|
|
nok_pokflag () |
4898
|
|
|
|
|
|
|
|
4899
|
|
|
|
|
|
|
|
4900
|
|
|
|
|
|
|
void |
4901
|
|
|
|
|
|
|
clear_nok_pok () |
4902
|
|
|
|
|
|
|
|
4903
|
|
|
|
|
|
|
PREINIT: |
4904
|
|
|
|
|
|
|
I32* temp; |
4905
|
|
|
|
|
|
|
PPCODE: |
4906
|
0
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4907
|
0
|
|
|
|
|
|
clear_nok_pok(); |
4908
|
0
|
0
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4909
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4910
|
0
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4911
|
0
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4912
|
|
|
|
|
|
|
} |
4913
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4914
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4915
|
|
|
|
|
|
|
|
4916
|
|
|
|
|
|
|
void |
4917
|
|
|
|
|
|
|
set_nok_pok (x) |
4918
|
|
|
|
|
|
|
int x |
4919
|
|
|
|
|
|
|
PREINIT: |
4920
|
|
|
|
|
|
|
I32* temp; |
4921
|
|
|
|
|
|
|
PPCODE: |
4922
|
3
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
4923
|
3
|
|
|
|
|
|
set_nok_pok(x); |
4924
|
3
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
4925
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
4926
|
3
|
|
|
|
|
|
PL_markstack_ptr = temp; |
4927
|
3
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
4928
|
|
|
|
|
|
|
} |
4929
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
4930
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
4931
|
|
|
|
|
|
|
|
4932
|
|
|
|
|
|
|
int |
4933
|
|
|
|
|
|
|
_SvNOK (in) |
4934
|
|
|
|
|
|
|
SV * in |
4935
|
|
|
|
|
|
|
CODE: |
4936
|
116
|
|
|
|
|
|
RETVAL = _SvNOK (aTHX_ in); |
4937
|
|
|
|
|
|
|
OUTPUT: RETVAL |
4938
|
|
|
|
|
|
|
|
4939
|
|
|
|
|
|
|
int |
4940
|
|
|
|
|
|
|
_SvPOK (in) |
4941
|
|
|
|
|
|
|
SV * in |
4942
|
|
|
|
|
|
|
CODE: |
4943
|
20
|
|
|
|
|
|
RETVAL = _SvPOK (aTHX_ in); |
4944
|
|
|
|
|
|
|
OUTPUT: RETVAL |
4945
|
|
|
|
|
|
|
|
4946
|
|
|
|
|
|
|
int |
4947
|
|
|
|
|
|
|
_avoid_inf_cast () |
4948
|
|
|
|
|
|
|
|
4949
|
|
|
|
|
|
|
|