| 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_decimal64_include.h" |
| 16 |
|
| |
| 17 |
|
| typedef _Decimal64 D64; |
| 18 |
|
| |
| 19 |
|
| int nnum = 0; /* flag that is incremented whenever _atodecimal is handed something non-numeric */ |
| 20 |
|
| |
| 21 |
|
| long long add_on[54] = {1ll,2ll, 4ll, 8ll, 16ll, 32ll, 64ll, 128ll, 256ll, 512ll, 1024ll, 2048ll, |
| 22 |
|
| 4096ll, 8192ll, 16384ll, 32768ll, 65536ll, 131072ll, 262144ll, 524288ll, |
| 23 |
|
| 1048576ll, 2097152ll, 4194304ll, 8388608ll, 16777216ll, 33554432ll, |
| 24 |
|
| 67108864ll, 134217728ll, 268435456ll, 536870912ll, 1073741824ll, |
| 25 |
|
| 2147483648ll, 4294967296ll, 8589934592ll, 17179869184ll, 34359738368ll, |
| 26 |
|
| 68719476736ll, 137438953472ll, 274877906944ll, 549755813888ll, |
| 27 |
|
| 1099511627776ll, 2199023255552ll, 4398046511104ll, 8796093022208ll, |
| 28 |
|
| 17592186044416ll, 35184372088832ll, 70368744177664ll, 140737488355328ll, |
| 29 |
|
| 281474976710656ll, 562949953421312ll, 1125899906842624ll, 2251799813685248ll, |
| 30 |
|
| 4503599627370496ll, 9007199254740992ll}; |
| 31 |
|
| |
| 32 |
29230 |
| _Decimal64 _exp10 (int power) { |
| 33 |
|
| |
| 34 |
29230 |
| _Decimal64 ret = 1.DD; |
| 35 |
|
| |
| 36 |
29230 |
▶ | if(power < 0) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(power < 0) { |
14220 |
15010 |
29230 |
|
| 37 |
52823 |
▶ | while(power < -100) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(power < -100) { |
38603 |
14220 |
52823 |
|
| 38 |
38603 |
| ret *= 1e-100DD; |
| 39 |
38603 |
| power += 100; |
| 40 |
|
| } |
| 41 |
94910 |
▶ | while(power < -10) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(power < -10) { |
80690 |
14220 |
94910 |
|
| 42 |
80690 |
| ret *= 1e-10DD; |
| 43 |
80690 |
| power += 10; |
| 44 |
|
| } |
| 45 |
100696 |
▶ | while(power) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(power) { |
86476 |
14220 |
100696 |
|
| 46 |
86476 |
| ret *= 1e-1DD; |
| 47 |
86476 |
| power++; |
| 48 |
|
| } |
| 49 |
|
| } |
| 50 |
|
| else { |
| 51 |
53782 |
▶ | while(power > 100) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(power > 100) { |
38772 |
15010 |
53782 |
|
| 52 |
38772 |
| ret *= 1e100DD; |
| 53 |
38772 |
| power -= 100; |
| 54 |
|
| } |
| 55 |
93521 |
▶ | while(power > 10) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(power > 10) { |
78511 |
15010 |
93521 |
|
| 56 |
78511 |
| ret *= 1e10DD; |
| 57 |
78511 |
| power -= 10; |
| 58 |
|
| } |
| 59 |
87419 |
▶ | while(power) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(power) { |
72409 |
15010 |
87419 |
|
| 60 |
72409 |
| ret *= 1e1DD; |
| 61 |
72409 |
| power--; |
| 62 |
|
| } |
| 63 |
|
| } |
| 64 |
29230 |
| return ret; |
| 65 |
|
| } |
| 66 |
|
| |
| 67 |
48235 |
| int _is_nan(_Decimal64 x) { |
| 68 |
48235 |
▶ | if(x == x) return 0; |
Branch: 1 branch
| Branch | True | False | Total |
| if(x == x) return 0; |
48197 |
38 |
48235 |
|
| 69 |
38 |
| return 1; |
| 70 |
|
| } |
| 71 |
|
| |
| 72 |
48244 |
| int _is_inf(_Decimal64 x) { |
| 73 |
48244 |
▶ | if(x != x) return 0; /* NaN */ |
Branch: 1 branch
| Branch | True | False | Total |
| if(x != x) return 0; /* NaN */ |
0 |
48244 |
48244 |
|
| 74 |
48244 |
▶ | if(x == 0.0DD) return 0; /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| if(x == 0.0DD) return 0; /* Zero */ |
313 |
47931 |
48244 |
|
| 75 |
47931 |
▶ | if(x/x != x/x) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(x/x != x/x) { |
76 |
47855 |
47931 |
|
| 76 |
76 |
▶ | if(x < 0.0DD) return -1; |
Branch: 1 branch
| Branch | True | False | Total |
| if(x < 0.0DD) return -1; |
34 |
42 |
76 |
|
| 77 |
42 |
| else return 1; |
| 78 |
|
| } |
| 79 |
47855 |
| return 0; /* Finite Real */ |
| 80 |
|
| } |
| 81 |
|
| |
| 82 |
|
| /* Replaced */ |
| 83 |
|
| /* |
| 84 |
|
| //int _is_neg_zero(_Decimal64 x) { |
| 85 |
|
| // char * buffer; |
| 86 |
|
| // |
| 87 |
|
| // if(x != 0.0DD) return 0; |
| 88 |
|
| // |
| 89 |
|
| // Newx(buffer, 2, char); |
| 90 |
|
| // sprintf(buffer, "%.0f", (double)x); |
| 91 |
|
| // |
| 92 |
|
| // if(strcmp(buffer, "-0")) { |
| 93 |
|
| // Safefree(buffer); |
| 94 |
|
| // return 0; |
| 95 |
|
| // } |
| 96 |
|
| // |
| 97 |
|
| // Safefree(buffer); |
| 98 |
|
| // return 1; |
| 99 |
|
| //} |
| 100 |
|
| */ |
| 101 |
|
| |
| 102 |
226374 |
| int _is_neg_zero(_Decimal64 d64) { |
| 103 |
|
| |
| 104 |
226374 |
| int n = sizeof(_Decimal64); |
| 105 |
226374 |
| void * p = &d64; |
| 106 |
|
| |
| 107 |
|
| /***************************************************** |
| 108 |
|
| We perform the following oddness because of gcc's |
| 109 |
|
| buggy optimization of signed zero _Decimal64. |
| 110 |
|
| See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80692 |
| 111 |
|
| ******************************************************/ |
| 112 |
226374 |
▶ | if(d64 != 0.0DD) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 != 0.0DD) { |
225213 |
1161 |
226374 |
|
| 113 |
225213 |
▶ | if(d64 * -1.0DD == 0.0DD) return 1; /* it's a -0 */ |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 * -1.0DD == 0.0DD) return 1; /* it's a -0 */ |
0 |
225213 |
225213 |
|
| 114 |
225213 |
| return 0; /* it's not zero */ |
| 115 |
|
| } |
| 116 |
|
| |
| 117 |
|
| #ifdef WE_HAVE_BENDIAN /* Big Endian architecture */ |
| 118 |
|
| if(((unsigned char*)p)[0] >= 128) return 1; |
| 119 |
|
| #else |
| 120 |
1161 |
▶ | if(((unsigned char*)p)[n - 1] >= 128) return 1; |
Branch: 1 branch
| Branch | True | False | Total |
| if(((unsigned char*)p)[n - 1] >= 128) return 1; |
657 |
504 |
1161 |
|
| 121 |
|
| #endif |
| 122 |
504 |
| return 0; |
| 123 |
|
| } |
| 124 |
|
| |
| 125 |
0 |
| SV * _is_nan_NV(pTHX_ SV * x) { |
| 126 |
0 |
▶ | if(SvNV(x) == SvNV(x)) return newSViv(0); |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvNV(x) == SvNV(x)) return newSViv(0); |
0 |
0 |
0 |
|
| 127 |
0 |
| return newSViv(1); |
| 128 |
|
| } |
| 129 |
|
| |
| 130 |
0 |
| SV * _is_inf_NV(pTHX_ SV * x) { |
| 131 |
0 |
▶ | if(SvNV(x) != SvNV(x)) return 0; /* NaN */ |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvNV(x) != SvNV(x)) return 0; /* NaN */ |
0 |
0 |
0 |
|
| 132 |
0 |
▶ | if(SvNV(x) == 0.0) return newSViv(0); /* Zero */ |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvNV(x) == 0.0) return newSViv(0); /* Zero */ |
0 |
0 |
0 |
|
| 133 |
0 |
▶ | if(SvNV(x)/SvNV(x) != SvNV(x)/SvNV(x)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvNV(x)/SvNV(x) != SvNV(x)/SvNV(x)) { |
0 |
0 |
0 |
|
| 134 |
0 |
▶ | if(SvNV(x) < 0.0) return newSViv(-1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvNV(x) < 0.0) return newSViv(-1); |
0 |
0 |
0 |
|
| 135 |
0 |
| else return newSViv(1); |
| 136 |
|
| } |
| 137 |
0 |
| return newSVnv(0); /* Finite Real */ |
| 138 |
|
| } |
| 139 |
|
| |
| 140 |
0 |
| SV * _is_neg_zero_NV(pTHX_ SV * x) { |
| 141 |
|
| char buffer[3]; |
| 142 |
|
| |
| 143 |
0 |
▶ | if(SvNV(x) != 0.0) return newSViv(0); |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvNV(x) != 0.0) return newSViv(0); |
0 |
0 |
0 |
|
| 144 |
|
| |
| 145 |
0 |
| sprintf(buffer, "%.0f", (double)SvNV(x)); |
| 146 |
|
| |
| 147 |
0 |
▶ | if(strcmp(buffer, "-0")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strcmp(buffer, "-0")) { |
0 |
0 |
0 |
|
| 148 |
0 |
| return newSViv(0); |
| 149 |
|
| } |
| 150 |
|
| |
| 151 |
0 |
| return newSViv(1); |
| 152 |
|
| } |
| 153 |
|
| |
| 154 |
87 |
| _Decimal64 _get_inf(int sign) { |
| 155 |
87 |
▶ | if(sign < 0) return -1.0DD/0.0DD; |
Branch: 1 branch
| Branch | True | False | Total |
| if(sign < 0) return -1.0DD/0.0DD; |
17 |
70 |
87 |
|
| 156 |
70 |
| return 1.0DD/0.0DD; |
| 157 |
|
| } |
| 158 |
|
| |
| 159 |
44 |
| _Decimal64 _get_nan(void) { |
| 160 |
44 |
| _Decimal64 inf = _get_inf(1); |
| 161 |
44 |
| return inf/inf; |
| 162 |
|
| } |
| 163 |
|
| |
| 164 |
29735 |
| _Decimal64 _atodecimal(pTHX_ char * s) { |
| 165 |
|
| /* |
| 166 |
|
| plagiarising code available at |
| 167 |
|
| https://www.ibm.com/developerworks/community/wikis/home?lang=en_US#!/wiki/Power%20Systems/page/POWER6%20Decimal%20Floating%20Point%20(DFP) |
| 168 |
|
| The aim is that nnum be incremented iff looks_like_number() would return false for the given string |
| 169 |
|
| */ |
| 170 |
|
| |
| 171 |
29735 |
| _Decimal64 top = 0.DD, bot = 0.DD, result = 0.DD, div = 10.DD; |
| 172 |
29735 |
| int negative = 0, i = 0, exponent = 0, count = 0; |
| 173 |
|
| |
| 174 |
29735 |
▶ | if(!strcmp(s, "0 but true")) return 0.DD; |
Branch: 1 branch
| Branch | True | False | Total |
| if(!strcmp(s, "0 but true")) return 0.DD; |
1 |
29734 |
29735 |
|
| 175 |
|
| |
| 176 |
29779 |
▶ | while(s[0] == ' ' || s[0] == '\t' || s[0] == '\n' || s[0] == '\r' || s[0] == '\f') s++; |
Branch: 5 branches
| Branch | True | False | Total |
| while(s[0] == ' ' || s[0] == '\t' || s[0] == '\n' || s[0] == '\r' || s[0] == '\f') s++; |
29 |
29750 |
29779 |
| while(s[0] == ' ' || s[0] == '\t' || s[0] == '\n' || s[0] == '\r' || s[0] == '\f') s++; |
4 |
29746 |
29750 |
| while(s[0] == ' ' || s[0] == '\t' || s[0] == '\n' || s[0] == '\r' || s[0] == '\f') s++; |
4 |
29742 |
29746 |
| while(s[0] == ' ' || s[0] == '\t' || s[0] == '\n' || s[0] == '\r' || s[0] == '\f') s++; |
4 |
29738 |
29742 |
| while(s[0] == ' ' || s[0] == '\t' || s[0] == '\n' || s[0] == '\r' || s[0] == '\f') s++; |
4 |
29734 |
29738 |
|
| 177 |
|
| |
| 178 |
29734 |
▶ | if(s[0] == '-') { |
Branch: 1 branch
| Branch | True | False | Total |
| if(s[0] == '-') { |
14833 |
14901 |
29734 |
|
| 179 |
14833 |
| negative = -1; |
| 180 |
14833 |
| s++; |
| 181 |
|
| } |
| 182 |
|
| else { |
| 183 |
14901 |
▶ | if(s[0] == '+') s++; |
Branch: 1 branch
| Branch | True | False | Total |
| if(s[0] == '+') s++; |
12 |
14889 |
14901 |
|
| 184 |
|
| } |
| 185 |
|
| |
| 186 |
29734 |
▶ | if((s[0] == 'i' || s[0] == 'I') && (s[1] == 'n' || s[1] == 'N') && (s[2] == 'f' || s[2] == 'F')) { |
Branch: 6 branches
| Branch | True | False | Total |
| if((s[0] == 'i' || s[0] == 'I') && (s[1] == 'n' || s[1] == 'N') && (s[2] == 'f' || s[2] == 'F')) { |
29714 |
20 |
29734 |
| if((s[0] == 'i' || s[0] == 'I') && (s[1] == 'n' || s[1] == 'N') && (s[2] == 'f' || s[2] == 'F')) { |
1 |
29713 |
29714 |
| if((s[0] == 'i' || s[0] == 'I') && (s[1] == 'n' || s[1] == 'N') && (s[2] == 'f' || s[2] == 'F')) { |
0 |
21 |
21 |
| if((s[0] == 'i' || s[0] == 'I') && (s[1] == 'n' || s[1] == 'N') && (s[2] == 'f' || s[2] == 'F')) { |
0 |
0 |
0 |
| if((s[0] == 'i' || s[0] == 'I') && (s[1] == 'n' || s[1] == 'N') && (s[2] == 'f' || s[2] == 'F')) { |
0 |
21 |
21 |
| if((s[0] == 'i' || s[0] == 'I') && (s[1] == 'n' || s[1] == 'N') && (s[2] == 'f' || s[2] == 'F')) { |
0 |
0 |
0 |
|
| 187 |
21 |
▶ | if((s[3] == 'i' || s[3] == 'I') && (s[4] == 'n' || s[4] == 'N') && (s[5] == 'i' || s[5] == 'I') && |
Branch: 6 branches
| Branch | True | False | Total |
| if((s[3] == 'i' || s[3] == 'I') && (s[4] == 'n' || s[4] == 'N') && (s[5] == 'i' || s[5] == 'I') && |
18 |
3 |
21 |
| if((s[3] == 'i' || s[3] == 'I') && (s[4] == 'n' || s[4] == 'N') && (s[5] == 'i' || s[5] == 'I') && |
0 |
18 |
18 |
| if((s[3] == 'i' || s[3] == 'I') && (s[4] == 'n' || s[4] == 'N') && (s[5] == 'i' || s[5] == 'I') && |
0 |
3 |
3 |
| if((s[3] == 'i' || s[3] == 'I') && (s[4] == 'n' || s[4] == 'N') && (s[5] == 'i' || s[5] == 'I') && |
0 |
0 |
0 |
| if((s[3] == 'i' || s[3] == 'I') && (s[4] == 'n' || s[4] == 'N') && (s[5] == 'i' || s[5] == 'I') && |
0 |
3 |
3 |
| if((s[3] == 'i' || s[3] == 'I') && (s[4] == 'n' || s[4] == 'N') && (s[5] == 'i' || s[5] == 'I') && |
0 |
0 |
0 |
|
| 188 |
3 |
▶ | (s[6] == 't' || s[6] == 'T') && (s[7] == 'y' || s[7] == 'Y')) count = 5; |
Branch: 4 branches
| Branch | True | False | Total |
| (s[6] == 't' || s[6] == 'T') && (s[7] == 'y' || s[7] == 'Y')) count = 5; |
1 |
2 |
3 |
| (s[6] == 't' || s[6] == 'T') && (s[7] == 'y' || s[7] == 'Y')) count = 5; |
1 |
0 |
1 |
| (s[6] == 't' || s[6] == 'T') && (s[7] == 'y' || s[7] == 'Y')) count = 5; |
1 |
2 |
3 |
| (s[6] == 't' || s[6] == 'T') && (s[7] == 'y' || s[7] == 'Y')) count = 5; |
0 |
1 |
1 |
|
| 189 |
26 |
| for(i = 3 + count;;i++) { |
| 190 |
26 |
▶ | if(s[i] == 0) return _get_inf(negative); |
Branch: 1 branch
| Branch | True | False | Total |
| if(s[i] == 0) return _get_inf(negative); |
17 |
9 |
26 |
|
| 191 |
9 |
▶ | if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
Branch: 5 branches
| Branch | True | False | Total |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
4 |
5 |
9 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
4 |
0 |
4 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
4 |
0 |
4 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
4 |
0 |
4 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
4 |
0 |
4 |
|
| 192 |
4 |
| nnum++; |
| 193 |
4 |
▶ | if(SvIV(get_sv("Math::Decimal64::NNW", 0))) |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIV(get_sv("Math::Decimal64::NNW", 0))) |
0 |
4 |
4 |
|
| 194 |
0 |
| warn("string argument contains at least one non-numeric character"); |
| 195 |
4 |
| return _get_inf(negative); |
| 196 |
|
| } |
| 197 |
|
| } |
| 198 |
|
| } |
| 199 |
|
| |
| 200 |
29713 |
▶ | if((s[0] == 'n' || s[0] == 'N') && (s[1] == 'a' || s[1] == 'A') && (s[2] == 'n' || s[2] == 'N')) { |
Branch: 6 branches
| Branch | True | False | Total |
| if((s[0] == 'n' || s[0] == 'N') && (s[1] == 'a' || s[1] == 'A') && (s[2] == 'n' || s[2] == 'N')) { |
29699 |
14 |
29713 |
| if((s[0] == 'n' || s[0] == 'N') && (s[1] == 'a' || s[1] == 'A') && (s[2] == 'n' || s[2] == 'N')) { |
0 |
29699 |
29699 |
| if((s[0] == 'n' || s[0] == 'N') && (s[1] == 'a' || s[1] == 'A') && (s[2] == 'n' || s[2] == 'N')) { |
0 |
14 |
14 |
| if((s[0] == 'n' || s[0] == 'N') && (s[1] == 'a' || s[1] == 'A') && (s[2] == 'n' || s[2] == 'N')) { |
0 |
0 |
0 |
| if((s[0] == 'n' || s[0] == 'N') && (s[1] == 'a' || s[1] == 'A') && (s[2] == 'n' || s[2] == 'N')) { |
0 |
14 |
14 |
| if((s[0] == 'n' || s[0] == 'N') && (s[1] == 'a' || s[1] == 'A') && (s[2] == 'n' || s[2] == 'N')) { |
0 |
0 |
0 |
|
| 201 |
14 |
| for(i = 3;;i++) { |
| 202 |
14 |
▶ | if(s[i] == 0) return _get_nan(); |
Branch: 1 branch
| Branch | True | False | Total |
| if(s[i] == 0) return _get_nan(); |
14 |
0 |
14 |
|
| 203 |
0 |
▶ | if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
Branch: 5 branches
| Branch | True | False | Total |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
0 |
0 |
0 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
0 |
0 |
0 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
0 |
0 |
0 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
0 |
0 |
0 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
0 |
0 |
0 |
|
| 204 |
0 |
| nnum++; |
| 205 |
0 |
▶ | if(SvIV(get_sv("Math::Decimal64::NNW", 0))) |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIV(get_sv("Math::Decimal64::NNW", 0))) |
0 |
0 |
0 |
|
| 206 |
0 |
| warn("string argument contains at least one non-numeric character"); |
| 207 |
0 |
| return _get_nan(); |
| 208 |
|
| } |
| 209 |
|
| } |
| 210 |
|
| } |
| 211 |
|
| |
| 212 |
|
| /* Must be a digit or a decimal point */ |
| 213 |
29699 |
▶ | if(!isdigit(s[0]) && s[0] != '.') { |
Branch: 2 branches
| Branch | True | False | Total |
| if(!isdigit(s[0]) && s[0] != '.') { |
1006 |
28693 |
29699 |
| if(!isdigit(s[0]) && s[0] != '.') { |
9 |
997 |
1006 |
|
| 214 |
9 |
| nnum++; |
| 215 |
9 |
▶ | if(SvIV(get_sv("Math::Decimal64::NNW", 0))) |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIV(get_sv("Math::Decimal64::NNW", 0))) |
0 |
9 |
9 |
|
| 216 |
0 |
| warn("string argument contains at least one non-numeric character"); |
| 217 |
9 |
▶ | result = negative ? result * -1.DD : result; |
Branch: 1 branch
| Branch | True | False | Total |
| result = negative ? result * -1.DD : result; |
3 |
6 |
9 |
|
| 218 |
9 |
| return result; |
| 219 |
|
| } |
| 220 |
|
| |
| 221 |
218132 |
▶ | for(; isdigit(*s); s++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(; isdigit(*s); s++) { |
188442 |
29690 |
218132 |
|
| 222 |
188442 |
| top = top * 10.DD; |
| 223 |
188442 |
| top = top + *s - '0'; |
| 224 |
|
| } |
| 225 |
|
| |
| 226 |
29690 |
▶ | if(s[0] == '.') { |
Branch: 1 branch
| Branch | True | False | Total |
| if(s[0] == '.') { |
14917 |
14773 |
29690 |
|
| 227 |
14917 |
| s++; |
| 228 |
81242 |
▶ | for(i = 0; isdigit(s[i]) ;i++) { |
Branch: 1 branch
| Branch | True | False | Total |
| for(i = 0; isdigit(s[i]) ;i++) { |
66325 |
14917 |
81242 |
|
| 229 |
66325 |
| bot += (_Decimal64)(s[i] - '0') / (_Decimal64)div; |
| 230 |
66325 |
| div *= 10.DD; |
| 231 |
|
| } |
| 232 |
|
| } |
| 233 |
|
| |
| 234 |
29690 |
| result = top + bot; |
| 235 |
29690 |
▶ | if(negative) result *= -1.DD; |
Branch: 1 branch
| Branch | True | False | Total |
| if(negative) result *= -1.DD; |
14820 |
14870 |
29690 |
|
| 236 |
|
| |
| 237 |
29690 |
▶ | if(s[i] == 'e' || s[i] == 'E') { |
Branch: 2 branches
| Branch | True | False | Total |
| if(s[i] == 'e' || s[i] == 'E') { |
7757 |
21933 |
29690 |
| if(s[i] == 'e' || s[i] == 'E') { |
7297 |
460 |
7757 |
|
| 238 |
29230 |
| s += i + 1; |
| 239 |
29230 |
▶ | if(*s == '-') { |
Branch: 1 branch
| Branch | True | False | Total |
| if(*s == '-') { |
14220 |
15010 |
29230 |
|
| 240 |
14220 |
| s++; |
| 241 |
54643 |
▶ | for(i = 0; isdigit(s[i]);i++) exponent = (exponent * 10) + (s[i] - '0'); |
Branch: 1 branch
| Branch | True | False | Total |
| for(i = 0; isdigit(s[i]);i++) exponent = (exponent * 10) + (s[i] - '0'); |
40423 |
14220 |
54643 |
|
| 242 |
57712 |
▶ | while(exponent > 398) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(exponent > 398) { |
43492 |
14220 |
57712 |
|
| 243 |
43492 |
| result /= 10.DD; |
| 244 |
43492 |
| exponent--; |
| 245 |
|
| } |
| 246 |
14220 |
| result *= _exp10(-exponent); |
| 247 |
|
| |
| 248 |
|
| /* Check for non-numeric trailing characters, and increment nnum */ |
| 249 |
|
| /* (and return immediately) if we hit one */ |
| 250 |
0 |
| for(;;i++) { |
| 251 |
14220 |
▶ | if(s[i] == 0) return result; |
Branch: 1 branch
| Branch | True | False | Total |
| if(s[i] == 0) return result; |
14219 |
1 |
14220 |
|
| 252 |
1 |
▶ | if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
Branch: 5 branches
| Branch | True | False | Total |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
1 |
0 |
1 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
1 |
0 |
1 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
1 |
0 |
1 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
1 |
0 |
1 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
1 |
0 |
1 |
|
| 253 |
1 |
| nnum++; |
| 254 |
1 |
▶ | if(SvIV(get_sv("Math::Decimal64::NNW", 0))) |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIV(get_sv("Math::Decimal64::NNW", 0))) |
0 |
1 |
1 |
|
| 255 |
0 |
| warn("string argument contains at least one non-numeric character"); |
| 256 |
1 |
| return result; |
| 257 |
|
| } |
| 258 |
|
| } |
| 259 |
|
| } |
| 260 |
|
| |
| 261 |
15010 |
▶ | if(*s == '+') s++; |
Branch: 1 branch
| Branch | True | False | Total |
| if(*s == '+') s++; |
6 |
15004 |
15010 |
|
| 262 |
56593 |
▶ | for(i = 0; isdigit(s[i]);i++) exponent = (exponent * 10) + (s[i] - '0'); |
Branch: 1 branch
| Branch | True | False | Total |
| for(i = 0; isdigit(s[i]);i++) exponent = (exponent * 10) + (s[i] - '0'); |
41583 |
15010 |
56593 |
|
| 263 |
139353 |
▶ | while(exponent > 384) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(exponent > 384) { |
124343 |
15010 |
139353 |
|
| 264 |
124343 |
| result *= 10.DD; |
| 265 |
124343 |
| exponent--; |
| 266 |
|
| } |
| 267 |
15010 |
| result *= _exp10(exponent); |
| 268 |
|
| |
| 269 |
|
| |
| 270 |
|
| /* Check for non-numeric trailing characters, and increment nnum */ |
| 271 |
|
| /* (and return immediately) if we hit one */ |
| 272 |
1 |
| for(;;i++) { |
| 273 |
15011 |
▶ | if(s[i] == 0) return result; |
Branch: 1 branch
| Branch | True | False | Total |
| if(s[i] == 0) return result; |
15007 |
4 |
15011 |
|
| 274 |
4 |
▶ | if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
Branch: 5 branches
| Branch | True | False | Total |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
3 |
1 |
4 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
3 |
0 |
3 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
3 |
0 |
3 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
3 |
0 |
3 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
3 |
0 |
3 |
|
| 275 |
3 |
| nnum++; |
| 276 |
3 |
▶ | if(SvIV(get_sv("Math::Decimal64::NNW", 0))) |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIV(get_sv("Math::Decimal64::NNW", 0))) |
0 |
3 |
3 |
|
| 277 |
0 |
| warn("string argument contains at least one non-numeric character"); |
| 278 |
3 |
| return result; |
| 279 |
|
| } |
| 280 |
|
| } |
| 281 |
|
| } |
| 282 |
|
| |
| 283 |
|
| /* Check for non-numeric trailing characters, and increment nnum */ |
| 284 |
|
| /* (and return immediately) if we hit one */ |
| 285 |
3 |
| for(;;i++) { |
| 286 |
463 |
▶ | if(s[i] == 0) return result; |
Branch: 1 branch
| Branch | True | False | Total |
| if(s[i] == 0) return result; |
453 |
10 |
463 |
|
| 287 |
10 |
▶ | if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
Branch: 5 branches
| Branch | True | False | Total |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
7 |
3 |
10 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
7 |
0 |
7 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
7 |
0 |
7 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
7 |
0 |
7 |
| if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n' && s[i] != '\r' && s[i] != '\f') { |
7 |
0 |
7 |
|
| 288 |
7 |
| nnum++; |
| 289 |
7 |
▶ | if(SvIV(get_sv("Math::Decimal64::NNW", 0))) |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIV(get_sv("Math::Decimal64::NNW", 0))) |
0 |
7 |
7 |
|
| 290 |
0 |
| warn("string argument contains at least one non-numeric character"); |
| 291 |
7 |
| return result; |
| 292 |
|
| } |
| 293 |
|
| } |
| 294 |
|
| } |
| 295 |
|
| |
| 296 |
8 |
| SV * _DEC64_MAX(pTHX) { |
| 297 |
|
| _Decimal64 * d64; |
| 298 |
|
| SV * obj_ref, * obj; |
| 299 |
|
| |
| 300 |
8 |
| Newx(d64, 1, _Decimal64); |
| 301 |
8 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in DEC64_MAX function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in DEC64_MAX function"); |
0 |
8 |
8 |
|
| 302 |
|
| |
| 303 |
8 |
| obj_ref = newSV(0); |
| 304 |
8 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 305 |
|
| |
| 306 |
8 |
| *d64 = 9999999999999999e369DD; |
| 307 |
|
| |
| 308 |
|
| |
| 309 |
8 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 310 |
8 |
| SvREADONLY_on(obj); |
| 311 |
8 |
| return obj_ref; |
| 312 |
|
| } |
| 313 |
|
| |
| 314 |
9 |
| SV * _DEC64_MIN(pTHX) { |
| 315 |
|
| _Decimal64 * d64; |
| 316 |
|
| SV * obj_ref, * obj; |
| 317 |
|
| |
| 318 |
9 |
| Newx(d64, 1, _Decimal64); |
| 319 |
9 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in DEC64_MIN function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in DEC64_MIN function"); |
0 |
9 |
9 |
|
| 320 |
|
| |
| 321 |
9 |
| obj_ref = newSV(0); |
| 322 |
9 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 323 |
|
| |
| 324 |
9 |
| *d64 = 1e-398DD; |
| 325 |
|
| |
| 326 |
|
| |
| 327 |
9 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 328 |
9 |
| SvREADONLY_on(obj); |
| 329 |
9 |
| return obj_ref; |
| 330 |
|
| } |
| 331 |
|
| |
| 332 |
|
| |
| 333 |
28 |
| SV * NaND64(pTHX) { |
| 334 |
|
| _Decimal64 * d64; |
| 335 |
|
| SV * obj_ref, * obj; |
| 336 |
|
| |
| 337 |
28 |
| Newx(d64, 1, _Decimal64); |
| 338 |
28 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in NaND64 function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in NaND64 function"); |
0 |
28 |
28 |
|
| 339 |
|
| |
| 340 |
28 |
| obj_ref = newSV(0); |
| 341 |
28 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 342 |
|
| |
| 343 |
28 |
| *d64 = _get_nan(); |
| 344 |
|
| |
| 345 |
28 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 346 |
28 |
| SvREADONLY_on(obj); |
| 347 |
28 |
| return obj_ref; |
| 348 |
|
| } |
| 349 |
|
| |
| 350 |
18 |
| SV * InfD64(pTHX_ int sign) { |
| 351 |
|
| _Decimal64 * d64; |
| 352 |
|
| SV * obj_ref, * obj; |
| 353 |
|
| |
| 354 |
18 |
| Newx(d64, 1, _Decimal64); |
| 355 |
18 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in InfD64 function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in InfD64 function"); |
0 |
18 |
18 |
|
| 356 |
|
| |
| 357 |
18 |
| obj_ref = newSV(0); |
| 358 |
18 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 359 |
|
| |
| 360 |
18 |
| *d64 = _get_inf(sign); |
| 361 |
|
| |
| 362 |
18 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 363 |
18 |
| SvREADONLY_on(obj); |
| 364 |
18 |
| return obj_ref; |
| 365 |
|
| } |
| 366 |
|
| |
| 367 |
47780 |
| SV * ZeroD64(pTHX_ int sign) { |
| 368 |
|
| _Decimal64 * d64; |
| 369 |
|
| SV * obj_ref, * obj; |
| 370 |
|
| |
| 371 |
47780 |
| Newx(d64, 1, _Decimal64); |
| 372 |
47780 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in ZeroD64 function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in ZeroD64 function"); |
0 |
47780 |
47780 |
|
| 373 |
|
| |
| 374 |
47780 |
| obj_ref = newSV(0); |
| 375 |
47780 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 376 |
|
| |
| 377 |
47780 |
| *d64 = 0.0DD; |
| 378 |
47780 |
▶ | if(sign < 0) *d64 *= -1; |
Branch: 1 branch
| Branch | True | False | Total |
| if(sign < 0) *d64 *= -1; |
23888 |
23892 |
47780 |
|
| 379 |
|
| |
| 380 |
47780 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 381 |
47780 |
| SvREADONLY_on(obj); |
| 382 |
47780 |
| return obj_ref; |
| 383 |
|
| } |
| 384 |
|
| |
| 385 |
782 |
| SV * UnityD64(pTHX_ int sign) { |
| 386 |
|
| _Decimal64 * d64; |
| 387 |
|
| SV * obj_ref, * obj; |
| 388 |
|
| |
| 389 |
782 |
| Newx(d64, 1, _Decimal64); |
| 390 |
782 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in UnityD64 function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in UnityD64 function"); |
0 |
782 |
782 |
|
| 391 |
|
| |
| 392 |
782 |
| obj_ref = newSV(0); |
| 393 |
782 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 394 |
|
| |
| 395 |
782 |
| *d64 = 1.0DD; |
| 396 |
782 |
▶ | if(sign < 0) *d64 *= -1; |
Branch: 1 branch
| Branch | True | False | Total |
| if(sign < 0) *d64 *= -1; |
779 |
3 |
782 |
|
| 397 |
|
| |
| 398 |
782 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 399 |
782 |
| SvREADONLY_on(obj); |
| 400 |
782 |
| return obj_ref; |
| 401 |
|
| } |
| 402 |
|
| |
| 403 |
1543 |
| SV * Exp10(pTHX_ int power) { |
| 404 |
|
| _Decimal64 * d64; |
| 405 |
|
| SV * obj_ref, * obj; |
| 406 |
|
| |
| 407 |
|
| /* |
| 408 |
|
| Remove this condition - and let the value be set to 0 or Inf |
| 409 |
|
| if(power < -398 || power > 384) |
| 410 |
|
| croak("Argument supplied to Exp10 function (%d) is out of allowable range", power); |
| 411 |
|
| */ |
| 412 |
|
| |
| 413 |
1543 |
| Newx(d64, 1, _Decimal64); |
| 414 |
1543 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in Exp10 function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in Exp10 function"); |
0 |
1543 |
1543 |
|
| 415 |
|
| |
| 416 |
1543 |
| obj_ref = newSV(0); |
| 417 |
1543 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 418 |
|
| |
| 419 |
1543 |
| *d64 = 1.0DD; |
| 420 |
1543 |
▶ | if(power < 0) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(power < 0) { |
524 |
1019 |
1543 |
|
| 421 |
1580 |
▶ | while(power < -100) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(power < -100) { |
1056 |
524 |
1580 |
|
| 422 |
1056 |
| *d64 *= 1e-100DD; |
| 423 |
1056 |
| power += 100; |
| 424 |
|
| } |
| 425 |
2083 |
▶ | while(power < -10) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(power < -10) { |
1559 |
524 |
2083 |
|
| 426 |
1559 |
| *d64 *= 1e-10DD; |
| 427 |
1559 |
| power += 10; |
| 428 |
|
| } |
| 429 |
3302 |
▶ | while(power) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(power) { |
2778 |
524 |
3302 |
|
| 430 |
2778 |
| *d64 *= 1e-1DD; |
| 431 |
2778 |
| power++; |
| 432 |
|
| } |
| 433 |
|
| } |
| 434 |
|
| else { |
| 435 |
2087 |
▶ | while(power > 100) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(power > 100) { |
1068 |
1019 |
2087 |
|
| 436 |
1068 |
| *d64 *= 1e100DD; |
| 437 |
1068 |
| power -= 100; |
| 438 |
|
| } |
| 439 |
2871 |
▶ | while(power > 10) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(power > 10) { |
1852 |
1019 |
2871 |
|
| 440 |
1852 |
| *d64 *= 1e10DD; |
| 441 |
1852 |
| power -= 10; |
| 442 |
|
| } |
| 443 |
6121 |
▶ | while(power) { |
Branch: 1 branch
| Branch | True | False | Total |
| while(power) { |
5102 |
1019 |
6121 |
|
| 444 |
5102 |
| *d64 *= 1e1DD; |
| 445 |
5102 |
| power--; |
| 446 |
|
| } |
| 447 |
|
| } |
| 448 |
|
| |
| 449 |
1543 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 450 |
1543 |
| SvREADONLY_on(obj); |
| 451 |
1543 |
| return obj_ref; |
| 452 |
|
| } |
| 453 |
|
| |
| 454 |
3 |
| SV * _testvalD64(pTHX_ int sign) { |
| 455 |
|
| _Decimal64 * d64; |
| 456 |
|
| SV * obj_ref, * obj; |
| 457 |
|
| |
| 458 |
3 |
| Newx(d64, 1, _Decimal64); |
| 459 |
3 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in _testvalD64 function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in _testvalD64 function"); |
0 |
3 |
3 |
|
| 460 |
|
| |
| 461 |
3 |
| obj_ref = newSV(0); |
| 462 |
3 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 463 |
|
| |
| 464 |
3 |
| *d64 = 9307199254740993e-15DD; |
| 465 |
|
| |
| 466 |
3 |
▶ | if(sign < 0) *d64 *= -1; |
Branch: 1 branch
| Branch | True | False | Total |
| if(sign < 0) *d64 *= -1; |
1 |
2 |
3 |
|
| 467 |
|
| |
| 468 |
3 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 469 |
3 |
| SvREADONLY_on(obj); |
| 470 |
3 |
| return obj_ref; |
| 471 |
|
| } |
| 472 |
|
| |
| 473 |
546896 |
| SV * _MEtoD64(pTHX_ char * mantissa, SV * exponent) { |
| 474 |
|
| |
| 475 |
|
| _Decimal64 * d64; |
| 476 |
|
| SV * obj_ref, * obj; |
| 477 |
546896 |
| int exp = (int)SvIV(exponent), i; |
| 478 |
|
| char * ptr; |
| 479 |
|
| long double man; |
| 480 |
|
| |
| 481 |
546896 |
| man = strtold(mantissa, &ptr); |
| 482 |
|
| |
| 483 |
546896 |
| Newx(d64, 1, _Decimal64); |
| 484 |
546896 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in MEtoD64 function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in MEtoD64 function"); |
0 |
546896 |
546896 |
|
| 485 |
|
| |
| 486 |
546896 |
| obj_ref = newSV(0); |
| 487 |
546896 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 488 |
|
| |
| 489 |
546896 |
| *d64 = (_Decimal64)man; |
| 490 |
546896 |
▶ | if(exp < 0) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(exp < 0) { |
376992 |
169904 |
546896 |
|
| 491 |
40351744 |
▶ | for(i = 0; i > exp; --i) *d64 *= 0.1DD; |
Branch: 1 branch
| Branch | True | False | Total |
| for(i = 0; i > exp; --i) *d64 *= 0.1DD; |
39974752 |
376992 |
40351744 |
|
| 492 |
|
| } |
| 493 |
|
| else { |
| 494 |
33257210 |
▶ | for(i = 0; i < exp; ++i) *d64 *= 10.0DD; |
Branch: 1 branch
| Branch | True | False | Total |
| for(i = 0; i < exp; ++i) *d64 *= 10.0DD; |
33087306 |
169904 |
33257210 |
|
| 495 |
|
| } |
| 496 |
|
| |
| 497 |
546896 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 498 |
546896 |
| SvREADONLY_on(obj); |
| 499 |
546896 |
| return obj_ref; |
| 500 |
|
| } |
| 501 |
|
| |
| 502 |
65 |
| SV * NVtoD64(pTHX_ SV * x) { |
| 503 |
|
| |
| 504 |
|
| _Decimal64 * d64; |
| 505 |
|
| SV * obj_ref, * obj; |
| 506 |
|
| |
| 507 |
65 |
| Newx(d64, 1, _Decimal64); |
| 508 |
65 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in NVtoD64 function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in NVtoD64 function"); |
0 |
65 |
65 |
|
| 509 |
|
| |
| 510 |
65 |
| obj_ref = newSV(0); |
| 511 |
65 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 512 |
|
| |
| 513 |
65 |
| *d64 = (_Decimal64)SvNV(x); |
| 514 |
|
| |
| 515 |
65 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 516 |
65 |
| SvREADONLY_on(obj); |
| 517 |
65 |
| return obj_ref; |
| 518 |
|
| } |
| 519 |
|
| |
| 520 |
17 |
| SV * UVtoD64(pTHX_ SV * x) { |
| 521 |
|
| |
| 522 |
|
| _Decimal64 * d64; |
| 523 |
|
| SV * obj_ref, * obj; |
| 524 |
|
| |
| 525 |
17 |
| Newx(d64, 1, _Decimal64); |
| 526 |
17 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in UVtoD64 function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in UVtoD64 function"); |
0 |
17 |
17 |
|
| 527 |
|
| |
| 528 |
17 |
| obj_ref = newSV(0); |
| 529 |
17 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 530 |
|
| |
| 531 |
17 |
| *d64 = (_Decimal64)SvUV(x); |
| 532 |
|
| |
| 533 |
17 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 534 |
17 |
| SvREADONLY_on(obj); |
| 535 |
17 |
| return obj_ref; |
| 536 |
|
| } |
| 537 |
|
| |
| 538 |
19 |
| SV * IVtoD64(pTHX_ SV * x) { |
| 539 |
|
| |
| 540 |
|
| _Decimal64 * d64; |
| 541 |
|
| SV * obj_ref, * obj; |
| 542 |
|
| |
| 543 |
19 |
| Newx(d64, 1, _Decimal64); |
| 544 |
19 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in IVtoD64 function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in IVtoD64 function"); |
0 |
19 |
19 |
|
| 545 |
|
| |
| 546 |
19 |
| obj_ref = newSV(0); |
| 547 |
19 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 548 |
|
| |
| 549 |
19 |
| *d64 = (_Decimal64)SvIV(x); |
| 550 |
|
| |
| 551 |
19 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 552 |
19 |
| SvREADONLY_on(obj); |
| 553 |
19 |
| return obj_ref; |
| 554 |
|
| } |
| 555 |
|
| |
| 556 |
17539 |
| SV * PVtoD64(pTHX_ char * x) { |
| 557 |
|
| _Decimal64 * d64; |
| 558 |
|
| SV * obj_ref, * obj; |
| 559 |
|
| |
| 560 |
17539 |
| Newx(d64, 1, _Decimal64); |
| 561 |
17539 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in PVtoD64 function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in PVtoD64 function"); |
0 |
17539 |
17539 |
|
| 562 |
|
| |
| 563 |
17539 |
| obj_ref = newSV(0); |
| 564 |
17539 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 565 |
|
| |
| 566 |
17539 |
| *d64 = _atodecimal(aTHX_ x); |
| 567 |
|
| |
| 568 |
17539 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 569 |
17539 |
| SvREADONLY_on(obj); |
| 570 |
17539 |
| return obj_ref; |
| 571 |
|
| } |
| 572 |
|
| |
| 573 |
1 |
| SV * STRtoD64(pTHX_ char * x) { |
| 574 |
|
| #ifdef STRTOD64_AVAILABLE |
| 575 |
|
| _Decimal64 * d64; |
| 576 |
|
| char * ptr; |
| 577 |
|
| SV * obj_ref, * obj; |
| 578 |
|
| |
| 579 |
|
| Newx(d64, 1, _Decimal64); |
| 580 |
|
| if(d64 == NULL) croak("Failed to allocate memory in STRtoD64 function"); |
| 581 |
|
| |
| 582 |
|
| *d64 = strtod64(x, &ptr); |
| 583 |
|
| |
| 584 |
|
| obj_ref = newSV(0); |
| 585 |
|
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 586 |
|
| |
| 587 |
|
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 588 |
|
| SvREADONLY_on(obj); |
| 589 |
|
| return obj_ref; |
| 590 |
|
| #else |
| 591 |
1 |
| croak("The strtod64 function has not been made available"); |
| 592 |
|
| #endif |
| 593 |
|
| } |
| 594 |
|
| |
| 595 |
74 |
| int have_strtod64(void) { |
| 596 |
|
| #ifdef STRTOD64_AVAILABLE |
| 597 |
|
| return 1; |
| 598 |
|
| #else |
| 599 |
74 |
| return 0; |
| 600 |
|
| #endif |
| 601 |
|
| } |
| 602 |
|
| |
| 603 |
3 |
| SV * D64toNV(pTHX_ SV * d64) { |
| 604 |
3 |
| return newSVnv((NV)(*(INT2PTR(_Decimal64*, SvIVX(SvRV(d64)))))); |
| 605 |
|
| } |
| 606 |
|
| |
| 607 |
0 |
| void LDtoD64(pTHX_ SV * d64, SV * ld) { |
| 608 |
0 |
▶ | if(sv_isobject(d64) && sv_isobject(ld)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(sv_isobject(d64) && sv_isobject(ld)) { |
0 |
0 |
0 |
| if(sv_isobject(d64) && sv_isobject(ld)) { |
0 |
0 |
0 |
|
| 609 |
0 |
▶ | const char *h1 = HvNAME(SvSTASH(SvRV(d64))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h1 = HvNAME(SvSTASH(SvRV(d64))); |
0 |
0 |
0 |
| const char *h1 = HvNAME(SvSTASH(SvRV(d64))); |
0 |
0 |
0 |
| const char *h1 = HvNAME(SvSTASH(SvRV(d64))); |
0 |
0 |
0 |
| const char *h1 = HvNAME(SvSTASH(SvRV(d64))); |
0 |
0 |
0 |
| const char *h1 = HvNAME(SvSTASH(SvRV(d64))); |
0 |
0 |
0 |
| const char *h1 = HvNAME(SvSTASH(SvRV(d64))); |
0 |
0 |
0 |
|
| 610 |
0 |
▶ | const char *h2 = HvNAME(SvSTASH(SvRV(ld))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h2 = HvNAME(SvSTASH(SvRV(ld))); |
0 |
0 |
0 |
| const char *h2 = HvNAME(SvSTASH(SvRV(ld))); |
0 |
0 |
0 |
| const char *h2 = HvNAME(SvSTASH(SvRV(ld))); |
0 |
0 |
0 |
| const char *h2 = HvNAME(SvSTASH(SvRV(ld))); |
0 |
0 |
0 |
| const char *h2 = HvNAME(SvSTASH(SvRV(ld))); |
0 |
0 |
0 |
| const char *h2 = HvNAME(SvSTASH(SvRV(ld))); |
0 |
0 |
0 |
|
| 611 |
0 |
▶ | if(strEQ(h1, "Math::Decimal64") && strEQ(h2, "Math::LongDouble")) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(strEQ(h1, "Math::Decimal64") && strEQ(h2, "Math::LongDouble")) { |
0 |
0 |
0 |
| if(strEQ(h1, "Math::Decimal64") && strEQ(h2, "Math::LongDouble")) { |
0 |
0 |
0 |
|
| 612 |
0 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(d64)))) = (_Decimal64)*(INT2PTR(long double *, SvIVX(SvRV(ld)))); |
| 613 |
|
| } |
| 614 |
0 |
| else croak("Invalid object supplied to Math::Decimal64::LDtoD64"); |
| 615 |
|
| } |
| 616 |
0 |
| else croak("Invalid argument supplied to Math::Decimal64::LDtoD64"); |
| 617 |
0 |
| } |
| 618 |
|
| |
| 619 |
0 |
| void D64toLD(pTHX_ SV * ld, SV * d64) { |
| 620 |
0 |
▶ | if(sv_isobject(d64) && sv_isobject(ld)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(sv_isobject(d64) && sv_isobject(ld)) { |
0 |
0 |
0 |
| if(sv_isobject(d64) && sv_isobject(ld)) { |
0 |
0 |
0 |
|
| 621 |
0 |
▶ | const char *h1 = HvNAME(SvSTASH(SvRV(d64))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h1 = HvNAME(SvSTASH(SvRV(d64))); |
0 |
0 |
0 |
| const char *h1 = HvNAME(SvSTASH(SvRV(d64))); |
0 |
0 |
0 |
| const char *h1 = HvNAME(SvSTASH(SvRV(d64))); |
0 |
0 |
0 |
| const char *h1 = HvNAME(SvSTASH(SvRV(d64))); |
0 |
0 |
0 |
| const char *h1 = HvNAME(SvSTASH(SvRV(d64))); |
0 |
0 |
0 |
| const char *h1 = HvNAME(SvSTASH(SvRV(d64))); |
0 |
0 |
0 |
|
| 622 |
0 |
▶ | const char *h2 = HvNAME(SvSTASH(SvRV(ld))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h2 = HvNAME(SvSTASH(SvRV(ld))); |
0 |
0 |
0 |
| const char *h2 = HvNAME(SvSTASH(SvRV(ld))); |
0 |
0 |
0 |
| const char *h2 = HvNAME(SvSTASH(SvRV(ld))); |
0 |
0 |
0 |
| const char *h2 = HvNAME(SvSTASH(SvRV(ld))); |
0 |
0 |
0 |
| const char *h2 = HvNAME(SvSTASH(SvRV(ld))); |
0 |
0 |
0 |
| const char *h2 = HvNAME(SvSTASH(SvRV(ld))); |
0 |
0 |
0 |
|
| 623 |
0 |
▶ | if(strEQ(h1, "Math::Decimal64") && strEQ(h2, "Math::LongDouble")) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(strEQ(h1, "Math::Decimal64") && strEQ(h2, "Math::LongDouble")) { |
0 |
0 |
0 |
| if(strEQ(h1, "Math::Decimal64") && strEQ(h2, "Math::LongDouble")) { |
0 |
0 |
0 |
|
| 624 |
0 |
| *(INT2PTR(long double *, SvIVX(SvRV(ld)))) = (long double)*(INT2PTR(_Decimal64 *, SvIVX(SvRV(d64)))); |
| 625 |
|
| } |
| 626 |
0 |
| else croak("Invalid object supplied to Math::Decimal64::D64toLD"); |
| 627 |
|
| } |
| 628 |
0 |
| else croak("Invalid argument supplied to Math::Decimal64::D64toLD"); |
| 629 |
0 |
| } |
| 630 |
|
| |
| 631 |
618765 |
| void DESTROY(pTHX_ SV * rop) { |
| 632 |
618765 |
| Safefree(INT2PTR(_Decimal64 *, SvIVX(SvRV(rop)))); |
| 633 |
618765 |
| } |
| 634 |
|
| |
| 635 |
8 |
| void _assignME(pTHX_ SV * a, char * mantissa, SV * c) { |
| 636 |
|
| char * ptr; |
| 637 |
|
| long double man; |
| 638 |
8 |
| int exp = (int)SvIV(c), i; |
| 639 |
|
| |
| 640 |
8 |
| man = strtold(mantissa, &ptr); |
| 641 |
|
| |
| 642 |
8 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) = (_Decimal64)man; |
| 643 |
|
| |
| 644 |
8 |
▶ | if(exp < 0) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(exp < 0) { |
4 |
4 |
8 |
|
| 645 |
112 |
▶ | for(i = 0; i > exp; --i) *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) *= 0.1DD; |
Branch: 1 branch
| Branch | True | False | Total |
| for(i = 0; i > exp; --i) *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) *= 0.1DD; |
108 |
4 |
112 |
|
| 646 |
|
| } |
| 647 |
|
| else { |
| 648 |
406 |
▶ | for(i = 0; i < exp; ++i) *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) *= 10.0DD; |
Branch: 1 branch
| Branch | True | False | Total |
| for(i = 0; i < exp; ++i) *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) *= 10.0DD; |
402 |
4 |
406 |
|
| 649 |
|
| } |
| 650 |
8 |
| } |
| 651 |
|
| |
| 652 |
|
| |
| 653 |
12111 |
| void assignPV(pTHX_ SV * a, char * s) { |
| 654 |
12111 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) = _atodecimal(aTHX_ s); |
| 655 |
12111 |
| } |
| 656 |
|
| |
| 657 |
2 |
| void assignIV(pTHX_ SV * a, SV * val) { |
| 658 |
|
| |
| 659 |
2 |
▶ | if(sv_isobject(a)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(a)) { |
2 |
0 |
2 |
|
| 660 |
2 |
▶ | const char * h = HvNAME(SvSTASH(SvRV(a))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
2 |
0 |
2 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
2 |
0 |
2 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
2 |
2 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
0 |
0 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
2 |
0 |
2 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
2 |
2 |
|
| 661 |
2 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
2 |
0 |
2 |
|
| 662 |
2 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) = (_Decimal64)SvIV(val); |
| 663 |
|
| } |
| 664 |
0 |
| else croak("Invalid object supplied to Math::Decimal64::assignIV function"); |
| 665 |
|
| } |
| 666 |
0 |
| else croak("Invalid argument supplied to Math::Decimal64::assignIV function"); |
| 667 |
|
| |
| 668 |
2 |
| } |
| 669 |
|
| |
| 670 |
1 |
| void assignUV(pTHX_ SV * a, SV * val) { |
| 671 |
|
| |
| 672 |
1 |
▶ | if(sv_isobject(a)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(a)) { |
1 |
0 |
1 |
|
| 673 |
1 |
▶ | const char * h = HvNAME(SvSTASH(SvRV(a))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
1 |
0 |
1 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
1 |
0 |
1 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
1 |
1 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
0 |
0 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
1 |
0 |
1 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
1 |
1 |
|
| 674 |
1 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
1 |
0 |
1 |
|
| 675 |
1 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) = (_Decimal64)SvUV(val); |
| 676 |
|
| } |
| 677 |
0 |
| else croak("Invalid object supplied to Math::Decimal64::assignUV function"); |
| 678 |
|
| } |
| 679 |
0 |
| else croak("Invalid argument supplied to Math::Decimal64::assignUV function"); |
| 680 |
|
| |
| 681 |
1 |
| } |
| 682 |
|
| |
| 683 |
2 |
| void assignNV(pTHX_ SV * a, SV * val) { |
| 684 |
|
| |
| 685 |
2 |
▶ | if(sv_isobject(a)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(a)) { |
2 |
0 |
2 |
|
| 686 |
2 |
▶ | const char * h = HvNAME(SvSTASH(SvRV(a))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
2 |
0 |
2 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
2 |
0 |
2 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
2 |
2 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
0 |
0 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
2 |
0 |
2 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
2 |
2 |
|
| 687 |
2 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
2 |
0 |
2 |
|
| 688 |
2 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) = (_Decimal64)SvNV(val); |
| 689 |
|
| } |
| 690 |
0 |
| else croak("Invalid object supplied to Math::Decimal64::assignNV function"); |
| 691 |
|
| } |
| 692 |
0 |
| else croak("Invalid argument supplied to Math::Decimal64::assignNV function"); |
| 693 |
|
| |
| 694 |
2 |
| } |
| 695 |
|
| |
| 696 |
1 |
| void assignD64(pTHX_ SV * a, SV * val) { |
| 697 |
|
| |
| 698 |
1 |
▶ | if(sv_isobject(a) && sv_isobject(val)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(sv_isobject(a) && sv_isobject(val)) { |
1 |
0 |
1 |
| if(sv_isobject(a) && sv_isobject(val)) { |
1 |
0 |
1 |
|
| 699 |
1 |
▶ | const char * h = HvNAME(SvSTASH(SvRV(a))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
1 |
0 |
1 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
1 |
0 |
1 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
1 |
1 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
0 |
0 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
1 |
0 |
1 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
1 |
1 |
|
| 700 |
1 |
▶ | const char * hh = HvNAME(SvSTASH(SvRV(val))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char * hh = HvNAME(SvSTASH(SvRV(val))); |
1 |
0 |
1 |
| const char * hh = HvNAME(SvSTASH(SvRV(val))); |
1 |
0 |
1 |
| const char * hh = HvNAME(SvSTASH(SvRV(val))); |
0 |
1 |
1 |
| const char * hh = HvNAME(SvSTASH(SvRV(val))); |
0 |
0 |
0 |
| const char * hh = HvNAME(SvSTASH(SvRV(val))); |
1 |
0 |
1 |
| const char * hh = HvNAME(SvSTASH(SvRV(val))); |
0 |
1 |
1 |
|
| 701 |
1 |
▶ | if(strEQ(h, "Math::Decimal64") && strEQ(hh, "Math::Decimal64")) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64") && strEQ(hh, "Math::Decimal64")) { |
1 |
0 |
1 |
| if(strEQ(h, "Math::Decimal64") && strEQ(hh, "Math::Decimal64")) { |
1 |
0 |
1 |
|
| 702 |
1 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(val)))); |
| 703 |
|
| } |
| 704 |
0 |
| else croak("Invalid object supplied to Math::Decimal64::assignD64 function"); |
| 705 |
|
| } |
| 706 |
0 |
| else croak("Invalid argument supplied to Math::Decimal64::assignD64 function"); |
| 707 |
|
| |
| 708 |
1 |
| } |
| 709 |
|
| |
| 710 |
2 |
| void assignNaN(pTHX_ SV * a) { |
| 711 |
|
| |
| 712 |
2 |
▶ | if(sv_isobject(a)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(a)) { |
2 |
0 |
2 |
|
| 713 |
2 |
▶ | const char * h = HvNAME(SvSTASH(SvRV(a))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
2 |
0 |
2 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
2 |
0 |
2 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
2 |
2 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
0 |
0 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
2 |
0 |
2 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
2 |
2 |
|
| 714 |
2 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
2 |
0 |
2 |
|
| 715 |
2 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) = _get_nan(); |
| 716 |
|
| } |
| 717 |
0 |
| else croak("Invalid object supplied to Math::Decimal64::assignNaN function"); |
| 718 |
|
| } |
| 719 |
0 |
| else croak("Invalid argument supplied to Math::Decimal64::assignNaN function"); |
| 720 |
2 |
| } |
| 721 |
|
| |
| 722 |
4 |
| void assignInf(pTHX_ SV * a, int sign) { |
| 723 |
|
| |
| 724 |
4 |
▶ | if(sv_isobject(a)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(a)) { |
4 |
0 |
4 |
|
| 725 |
4 |
▶ | const char * h = HvNAME(SvSTASH(SvRV(a))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
4 |
0 |
4 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
4 |
0 |
4 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
4 |
4 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
0 |
0 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
4 |
0 |
4 |
| const char * h = HvNAME(SvSTASH(SvRV(a))); |
0 |
4 |
4 |
|
| 726 |
4 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
4 |
0 |
4 |
|
| 727 |
4 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) = _get_inf(sign); |
| 728 |
|
| } |
| 729 |
0 |
| else croak("Invalid object supplied to Math::Decimal64::assignInf function"); |
| 730 |
|
| } |
| 731 |
0 |
| else croak("Invalid argument supplied to Math::Decimal64::assignInf function"); |
| 732 |
4 |
| } |
| 733 |
|
| |
| 734 |
43 |
| SV * _overload_add(pTHX_ SV * a, SV * b, SV * third) { |
| 735 |
|
| |
| 736 |
|
| _Decimal64 * d64; |
| 737 |
|
| SV * obj_ref, * obj; |
| 738 |
|
| |
| 739 |
43 |
| Newx(d64, 1, _Decimal64); |
| 740 |
43 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in _overload_add function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in _overload_add function"); |
0 |
43 |
43 |
|
| 741 |
|
| |
| 742 |
43 |
| obj_ref = newSV(0); |
| 743 |
43 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 744 |
|
| |
| 745 |
43 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 746 |
43 |
| SvREADONLY_on(obj); |
| 747 |
|
| |
| 748 |
43 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
0 |
43 |
43 |
|
| 749 |
0 |
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) + (D64)SvUVX(b); |
| 750 |
0 |
| return obj_ref; |
| 751 |
|
| } |
| 752 |
|
| |
| 753 |
43 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
3 |
40 |
43 |
|
| 754 |
3 |
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) + (D64)SvIVX(b); |
| 755 |
3 |
| return obj_ref; |
| 756 |
|
| } |
| 757 |
|
| |
| 758 |
40 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
17 |
23 |
40 |
| if(SvPOK(b) && !SvNOK(b)) { |
17 |
0 |
17 |
|
| 759 |
34 |
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) + _atodecimal(aTHX_ SvPV_nolen(b)); |
| 760 |
17 |
| return obj_ref; |
| 761 |
|
| } |
| 762 |
|
| |
| 763 |
23 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
23 |
0 |
23 |
|
| 764 |
23 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
23 |
0 |
23 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
23 |
0 |
23 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
23 |
23 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
23 |
0 |
23 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
23 |
23 |
|
| 765 |
23 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
23 |
0 |
23 |
|
| 766 |
23 |
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) + *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b)))); |
| 767 |
23 |
| return obj_ref; |
| 768 |
|
| } |
| 769 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_add function"); |
| 770 |
|
| } |
| 771 |
0 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_add function"); |
| 772 |
|
| } |
| 773 |
|
| |
| 774 |
852 |
| SV * _overload_mul(pTHX_ SV * a, SV * b, SV * third) { |
| 775 |
|
| |
| 776 |
|
| _Decimal64 * d64; |
| 777 |
|
| SV * obj_ref, * obj; |
| 778 |
|
| |
| 779 |
852 |
| Newx(d64, 1, _Decimal64); |
| 780 |
852 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in _overload_mul function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in _overload_mul function"); |
0 |
852 |
852 |
|
| 781 |
|
| |
| 782 |
852 |
| obj_ref = newSV(0); |
| 783 |
852 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 784 |
|
| |
| 785 |
852 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 786 |
852 |
| SvREADONLY_on(obj); |
| 787 |
|
| |
| 788 |
852 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
0 |
852 |
852 |
|
| 789 |
0 |
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) * (D64)SvUVX(b); |
| 790 |
0 |
| return obj_ref; |
| 791 |
|
| } |
| 792 |
|
| |
| 793 |
852 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
65 |
787 |
852 |
|
| 794 |
65 |
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) * (D64)SvIVX(b); |
| 795 |
65 |
| return obj_ref; |
| 796 |
|
| } |
| 797 |
|
| |
| 798 |
787 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
1 |
786 |
787 |
| if(SvPOK(b) && !SvNOK(b)) { |
1 |
0 |
1 |
|
| 799 |
2 |
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) * _atodecimal(aTHX_ SvPV_nolen(b)); |
| 800 |
1 |
| return obj_ref; |
| 801 |
|
| } |
| 802 |
|
| |
| 803 |
786 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
786 |
0 |
786 |
|
| 804 |
786 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
786 |
0 |
786 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
786 |
0 |
786 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
786 |
786 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
786 |
0 |
786 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
786 |
786 |
|
| 805 |
786 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
786 |
0 |
786 |
|
| 806 |
786 |
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) * *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b)))); |
| 807 |
786 |
| return obj_ref; |
| 808 |
|
| } |
| 809 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_mul function"); |
| 810 |
|
| } |
| 811 |
0 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_mul function"); |
| 812 |
|
| } |
| 813 |
|
| |
| 814 |
36 |
| SV * _overload_sub(pTHX_ SV * a, SV * b, SV * third) { |
| 815 |
|
| |
| 816 |
|
| _Decimal64 * d64; |
| 817 |
|
| SV * obj_ref, * obj; |
| 818 |
|
| |
| 819 |
36 |
| Newx(d64, 1, _Decimal64); |
| 820 |
36 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in _overload_sub function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in _overload_sub function"); |
0 |
36 |
36 |
|
| 821 |
|
| |
| 822 |
36 |
| obj_ref = newSV(0); |
| 823 |
36 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 824 |
|
| |
| 825 |
36 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 826 |
36 |
| SvREADONLY_on(obj); |
| 827 |
|
| |
| 828 |
36 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
0 |
36 |
36 |
|
| 829 |
0 |
▶ | if(SWITCH_ARGS) *d64 = (D64)SvUVX(b) - *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) *d64 = (D64)SvUVX(b) - *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
0 |
0 |
0 |
|
| 830 |
0 |
| else *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) - (D64)SvUVX(b); |
| 831 |
0 |
| return obj_ref; |
| 832 |
|
| } |
| 833 |
|
| |
| 834 |
36 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
6 |
30 |
36 |
|
| 835 |
6 |
▶ | if(SWITCH_ARGS) *d64 = (D64)SvIVX(b) - *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) *d64 = (D64)SvIVX(b) - *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
2 |
4 |
6 |
|
| 836 |
4 |
| else *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) - (D64)SvIVX(b); |
| 837 |
6 |
| return obj_ref; |
| 838 |
|
| } |
| 839 |
|
| |
| 840 |
30 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
14 |
16 |
30 |
| if(SvPOK(b) && !SvNOK(b)) { |
14 |
0 |
14 |
|
| 841 |
14 |
▶ | if(SWITCH_ARGS) *d64 = _atodecimal(aTHX_ SvPV_nolen(b)) - *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) *d64 = _atodecimal(aTHX_ SvPV_nolen(b)) - *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
0 |
14 |
14 |
|
| 842 |
28 |
| else *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) - _atodecimal(aTHX_ SvPV_nolen(b)); |
| 843 |
14 |
| return obj_ref; |
| 844 |
|
| } |
| 845 |
|
| |
| 846 |
16 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
16 |
0 |
16 |
|
| 847 |
16 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
16 |
0 |
16 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
16 |
0 |
16 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
16 |
16 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
16 |
0 |
16 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
16 |
16 |
|
| 848 |
16 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
16 |
0 |
16 |
|
| 849 |
16 |
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) - *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b)))); |
| 850 |
16 |
| return obj_ref; |
| 851 |
|
| } |
| 852 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_sub function"); |
| 853 |
|
| } |
| 854 |
|
| /* replaced by _overload_neg |
| 855 |
|
| if(SWITCH_ARGS) { |
| 856 |
|
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) * -1.0DD; |
| 857 |
|
| return obj_ref; |
| 858 |
|
| } |
| 859 |
|
| */ |
| 860 |
0 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_sub function"); |
| 861 |
|
| } |
| 862 |
|
| |
| 863 |
4 |
| SV * _overload_neg(pTHX_ SV * a, SV * b, SV * third) { |
| 864 |
|
| |
| 865 |
|
| _Decimal64 * d64; |
| 866 |
|
| SV * obj_ref, * obj; |
| 867 |
|
| |
| 868 |
4 |
| Newx(d64, 1, _Decimal64); |
| 869 |
4 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in _overload_sub function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in _overload_sub function"); |
0 |
4 |
4 |
|
| 870 |
|
| |
| 871 |
4 |
| obj_ref = newSV(0); |
| 872 |
4 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 873 |
|
| |
| 874 |
4 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 875 |
4 |
| SvREADONLY_on(obj); |
| 876 |
|
| |
| 877 |
4 |
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) * -1.0DD; |
| 878 |
4 |
| return obj_ref; |
| 879 |
|
| } |
| 880 |
|
| |
| 881 |
30 |
| SV * _overload_div(pTHX_ SV * a, SV * b, SV * third) { |
| 882 |
|
| |
| 883 |
|
| _Decimal64 * d64; |
| 884 |
|
| SV * obj_ref, * obj; |
| 885 |
|
| |
| 886 |
30 |
| Newx(d64, 1, _Decimal64); |
| 887 |
30 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in _overload_div function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in _overload_div function"); |
0 |
30 |
30 |
|
| 888 |
|
| |
| 889 |
30 |
| obj_ref = newSV(0); |
| 890 |
30 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 891 |
|
| |
| 892 |
30 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 893 |
30 |
| SvREADONLY_on(obj); |
| 894 |
|
| |
| 895 |
30 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
0 |
30 |
30 |
|
| 896 |
0 |
▶ | if(SWITCH_ARGS) *d64 = (D64)SvUVX(b) / *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) *d64 = (D64)SvUVX(b) / *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
0 |
0 |
0 |
|
| 897 |
0 |
| else *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) / (D64)SvUVX(b); |
| 898 |
0 |
| return obj_ref; |
| 899 |
|
| } |
| 900 |
|
| |
| 901 |
30 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
3 |
27 |
30 |
|
| 902 |
3 |
▶ | if(SWITCH_ARGS) *d64 = (D64)SvIVX(b) / *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) *d64 = (D64)SvIVX(b) / *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
2 |
1 |
3 |
|
| 903 |
1 |
| else *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) / (D64)SvIVX(b); |
| 904 |
3 |
| return obj_ref; |
| 905 |
|
| } |
| 906 |
|
| |
| 907 |
27 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
1 |
26 |
27 |
| if(SvPOK(b) && !SvNOK(b)) { |
1 |
0 |
1 |
|
| 908 |
1 |
▶ | if(SWITCH_ARGS) *d64 = _atodecimal(aTHX_ SvPV_nolen(b)) / *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) *d64 = _atodecimal(aTHX_ SvPV_nolen(b)) / *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
0 |
1 |
1 |
|
| 909 |
2 |
| else *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) / _atodecimal(aTHX_ SvPV_nolen(b)); |
| 910 |
1 |
| return obj_ref; |
| 911 |
|
| } |
| 912 |
|
| |
| 913 |
26 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
26 |
0 |
26 |
|
| 914 |
26 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
26 |
0 |
26 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
26 |
0 |
26 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
26 |
26 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
26 |
0 |
26 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
26 |
26 |
|
| 915 |
26 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
26 |
0 |
26 |
|
| 916 |
26 |
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) / *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b)))); |
| 917 |
26 |
| return obj_ref; |
| 918 |
|
| } |
| 919 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_div function"); |
| 920 |
|
| } |
| 921 |
0 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_div function"); |
| 922 |
|
| } |
| 923 |
|
| |
| 924 |
200102 |
| SV * _overload_add_eq(pTHX_ SV * a, SV * b, SV * third) { |
| 925 |
|
| |
| 926 |
200102 |
| SvREFCNT_inc(a); |
| 927 |
|
| |
| 928 |
200102 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
0 |
200102 |
200102 |
|
| 929 |
0 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) += (D64)SvUVX(b); |
| 930 |
0 |
| return a; |
| 931 |
|
| } |
| 932 |
200102 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
1 |
200101 |
200102 |
|
| 933 |
1 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) += (D64)SvIVX(b); |
| 934 |
1 |
| return a; |
| 935 |
|
| } |
| 936 |
200101 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
1 |
200100 |
200101 |
| if(SvPOK(b) && !SvNOK(b)) { |
1 |
0 |
1 |
|
| 937 |
1 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) += _atodecimal(aTHX_ SvPV_nolen(b)); |
| 938 |
1 |
| return a; |
| 939 |
|
| } |
| 940 |
|
| |
| 941 |
200100 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
200100 |
0 |
200100 |
|
| 942 |
200100 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
200100 |
0 |
200100 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
200100 |
0 |
200100 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
200100 |
200100 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
200100 |
0 |
200100 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
200100 |
200100 |
|
| 943 |
200100 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
200100 |
0 |
200100 |
|
| 944 |
200100 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) += *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b)))); |
| 945 |
200100 |
| return a; |
| 946 |
|
| } |
| 947 |
0 |
| SvREFCNT_dec(a); |
| 948 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_add_eq function"); |
| 949 |
|
| } |
| 950 |
0 |
| SvREFCNT_dec(a); |
| 951 |
0 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_add_eq function"); |
| 952 |
|
| } |
| 953 |
|
| |
| 954 |
1552 |
| SV * _overload_mul_eq(pTHX_ SV * a, SV * b, SV * third) { |
| 955 |
|
| |
| 956 |
1552 |
| SvREFCNT_inc(a); |
| 957 |
|
| |
| 958 |
1552 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
0 |
1552 |
1552 |
|
| 959 |
0 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) *= (D64)SvUVX(b); |
| 960 |
0 |
| return a; |
| 961 |
|
| } |
| 962 |
1552 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
7 |
1545 |
1552 |
|
| 963 |
7 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) *= (D64)SvIVX(b); |
| 964 |
7 |
| return a; |
| 965 |
|
| } |
| 966 |
1545 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
1 |
1544 |
1545 |
| if(SvPOK(b) && !SvNOK(b)) { |
1 |
0 |
1 |
|
| 967 |
1 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) *= _atodecimal(aTHX_ SvPV_nolen(b)); |
| 968 |
1 |
| return a; |
| 969 |
|
| } |
| 970 |
|
| |
| 971 |
1544 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
1544 |
0 |
1544 |
|
| 972 |
1544 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
1544 |
0 |
1544 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
1544 |
0 |
1544 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
1544 |
1544 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
1544 |
0 |
1544 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
1544 |
1544 |
|
| 973 |
1544 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
1544 |
0 |
1544 |
|
| 974 |
1544 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) *= *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b)))); |
| 975 |
1544 |
| return a; |
| 976 |
|
| } |
| 977 |
0 |
| SvREFCNT_dec(a); |
| 978 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_mul_eq function"); |
| 979 |
|
| } |
| 980 |
0 |
| SvREFCNT_dec(a); |
| 981 |
0 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_mul_eq function"); |
| 982 |
|
| } |
| 983 |
|
| |
| 984 |
58840 |
| SV * _overload_sub_eq(pTHX_ SV * a, SV * b, SV * third) { |
| 985 |
|
| |
| 986 |
58840 |
| SvREFCNT_inc(a); |
| 987 |
|
| |
| 988 |
58840 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
0 |
58840 |
58840 |
|
| 989 |
0 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) -= (D64)SvUVX(b); |
| 990 |
0 |
| return a; |
| 991 |
|
| } |
| 992 |
58840 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
2 |
58838 |
58840 |
|
| 993 |
2 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) -= (D64)SvIVX(b); |
| 994 |
2 |
| return a; |
| 995 |
|
| } |
| 996 |
58838 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
1 |
58837 |
58838 |
| if(SvPOK(b) && !SvNOK(b)) { |
1 |
0 |
1 |
|
| 997 |
1 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) -= _atodecimal(aTHX_ SvPV_nolen(b)); |
| 998 |
1 |
| return a; |
| 999 |
|
| } |
| 1000 |
|
| |
| 1001 |
58837 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
58837 |
0 |
58837 |
|
| 1002 |
58837 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
58837 |
0 |
58837 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
58837 |
0 |
58837 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
58837 |
58837 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
58837 |
0 |
58837 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
58837 |
58837 |
|
| 1003 |
58837 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
58837 |
0 |
58837 |
|
| 1004 |
58837 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) -= *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b)))); |
| 1005 |
58837 |
| return a; |
| 1006 |
|
| } |
| 1007 |
0 |
| SvREFCNT_dec(a); |
| 1008 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_sub_eq function"); |
| 1009 |
|
| } |
| 1010 |
0 |
| SvREFCNT_dec(a); |
| 1011 |
0 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_sub_eq function"); |
| 1012 |
|
| } |
| 1013 |
|
| |
| 1014 |
22 |
| SV * _overload_div_eq(pTHX_ SV * a, SV * b, SV * third) { |
| 1015 |
|
| |
| 1016 |
22 |
| SvREFCNT_inc(a); |
| 1017 |
|
| |
| 1018 |
22 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
0 |
22 |
22 |
|
| 1019 |
0 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) /= (D64)SvUVX(b); |
| 1020 |
0 |
| return a; |
| 1021 |
|
| } |
| 1022 |
22 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
4 |
18 |
22 |
|
| 1023 |
4 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) /= (D64)SvIVX(b); |
| 1024 |
4 |
| return a; |
| 1025 |
|
| } |
| 1026 |
18 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
1 |
17 |
18 |
| if(SvPOK(b) && !SvNOK(b)) { |
1 |
0 |
1 |
|
| 1027 |
1 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) /= _atodecimal(aTHX_ SvPV_nolen(b)); |
| 1028 |
1 |
| return a; |
| 1029 |
|
| } |
| 1030 |
|
| |
| 1031 |
17 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
17 |
0 |
17 |
|
| 1032 |
17 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
17 |
0 |
17 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
17 |
0 |
17 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
17 |
17 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
17 |
0 |
17 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
17 |
17 |
|
| 1033 |
17 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
17 |
0 |
17 |
|
| 1034 |
17 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) /= *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b)))); |
| 1035 |
17 |
| return a; |
| 1036 |
|
| } |
| 1037 |
0 |
| SvREFCNT_dec(a); |
| 1038 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_div_eq function"); |
| 1039 |
|
| } |
| 1040 |
0 |
| SvREFCNT_dec(a); |
| 1041 |
0 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_div_eq function"); |
| 1042 |
|
| } |
| 1043 |
|
| |
| 1044 |
200134 |
| SV * _overload_equiv(pTHX_ SV * a, SV * b, SV * third) { |
| 1045 |
|
| |
| 1046 |
200134 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
0 |
200134 |
200134 |
|
| 1047 |
0 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == (D64)SvUVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == (D64)SvUVX(b)) return newSViv(1); |
0 |
0 |
0 |
|
| 1048 |
0 |
| return newSViv(0); |
| 1049 |
|
| } |
| 1050 |
|
| |
| 1051 |
200134 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
8 |
200126 |
200134 |
|
| 1052 |
8 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == (D64)SvIVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == (D64)SvIVX(b)) return newSViv(1); |
8 |
0 |
8 |
|
| 1053 |
0 |
| return newSViv(0); |
| 1054 |
|
| } |
| 1055 |
200126 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
9 |
200117 |
200126 |
| if(SvPOK(b) && !SvNOK(b)) { |
9 |
0 |
9 |
|
| 1056 |
18 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
9 |
0 |
9 |
|
| 1057 |
0 |
| return newSViv(0); |
| 1058 |
|
| } |
| 1059 |
|
| |
| 1060 |
200117 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
200116 |
1 |
200117 |
|
| 1061 |
200116 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
200116 |
0 |
200116 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
200116 |
0 |
200116 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
200116 |
200116 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
200116 |
0 |
200116 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
200116 |
200116 |
|
| 1062 |
200116 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
200116 |
0 |
200116 |
|
| 1063 |
200116 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(1); |
200111 |
5 |
200116 |
|
| 1064 |
5 |
| return newSViv(0); |
| 1065 |
|
| } |
| 1066 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_equiv function"); |
| 1067 |
|
| } |
| 1068 |
1 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_equiv function"); |
| 1069 |
|
| } |
| 1070 |
|
| |
| 1071 |
211739 |
| SV * _overload_not_equiv(pTHX_ SV * a, SV * b, SV * third) { |
| 1072 |
|
| |
| 1073 |
211739 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
1 |
211738 |
211739 |
|
| 1074 |
1 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) != (D64)SvUVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) != (D64)SvUVX(b)) return newSViv(1); |
0 |
1 |
1 |
|
| 1075 |
1 |
| return newSViv(0); |
| 1076 |
|
| } |
| 1077 |
|
| |
| 1078 |
211738 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
1 |
211737 |
211738 |
|
| 1079 |
1 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) != (D64)SvIVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) != (D64)SvIVX(b)) return newSViv(1); |
1 |
0 |
1 |
|
| 1080 |
0 |
| return newSViv(0); |
| 1081 |
|
| } |
| 1082 |
211737 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
3 |
211734 |
211737 |
| if(SvPOK(b) && !SvNOK(b)) { |
3 |
0 |
3 |
|
| 1083 |
6 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) != _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) != _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
3 |
0 |
3 |
|
| 1084 |
0 |
| return newSViv(0); |
| 1085 |
|
| } |
| 1086 |
|
| |
| 1087 |
211734 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
211734 |
0 |
211734 |
|
| 1088 |
211734 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
211734 |
0 |
211734 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
211734 |
0 |
211734 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
211734 |
211734 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
211734 |
0 |
211734 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
211734 |
211734 |
|
| 1089 |
211734 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
211734 |
0 |
211734 |
|
| 1090 |
211734 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(0); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(0); |
211715 |
19 |
211734 |
|
| 1091 |
19 |
| return newSViv(1); |
| 1092 |
|
| } |
| 1093 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_not_equiv function"); |
| 1094 |
|
| } |
| 1095 |
0 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_not_equiv function"); |
| 1096 |
|
| } |
| 1097 |
|
| |
| 1098 |
23905 |
| SV * _overload_lt(pTHX_ SV * a, SV * b, SV * third) { |
| 1099 |
|
| |
| 1100 |
23905 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
1 |
23904 |
23905 |
|
| 1101 |
1 |
▶ | if(SWITCH_ARGS) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) { |
1 |
0 |
1 |
|
| 1102 |
1 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > (D64)SvUVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > (D64)SvUVX(b)) return newSViv(1); |
0 |
1 |
1 |
|
| 1103 |
1 |
| return newSViv(0); |
| 1104 |
|
| } |
| 1105 |
0 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < (D64)SvUVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < (D64)SvUVX(b)) return newSViv(1); |
0 |
0 |
0 |
|
| 1106 |
0 |
| return newSViv(0); |
| 1107 |
|
| } |
| 1108 |
|
| |
| 1109 |
23904 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
4 |
23900 |
23904 |
|
| 1110 |
4 |
▶ | if(SWITCH_ARGS) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) { |
2 |
2 |
4 |
|
| 1111 |
2 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > (D64)SvIVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > (D64)SvIVX(b)) return newSViv(1); |
2 |
0 |
2 |
|
| 1112 |
0 |
| return newSViv(0); |
| 1113 |
|
| } |
| 1114 |
2 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < (D64)SvIVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < (D64)SvIVX(b)) return newSViv(1); |
2 |
0 |
2 |
|
| 1115 |
0 |
| return newSViv(0); |
| 1116 |
|
| } |
| 1117 |
|
| |
| 1118 |
23900 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
3 |
23897 |
23900 |
| if(SvPOK(b) && !SvNOK(b)) { |
3 |
0 |
3 |
|
| 1119 |
3 |
▶ | if(SWITCH_ARGS) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) { |
1 |
2 |
3 |
|
| 1120 |
2 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
1 |
0 |
1 |
|
| 1121 |
0 |
| return newSViv(0); |
| 1122 |
|
| } |
| 1123 |
4 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
2 |
0 |
2 |
|
| 1124 |
0 |
| return newSViv(0); |
| 1125 |
|
| } |
| 1126 |
|
| |
| 1127 |
23897 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
23896 |
1 |
23897 |
|
| 1128 |
23896 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
23896 |
0 |
23896 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
23896 |
0 |
23896 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
23896 |
23896 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
23896 |
0 |
23896 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
23896 |
23896 |
|
| 1129 |
23896 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
23896 |
0 |
23896 |
|
| 1130 |
23896 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(1); |
23894 |
2 |
23896 |
|
| 1131 |
2 |
| return newSViv(0); |
| 1132 |
|
| } |
| 1133 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_lt function"); |
| 1134 |
|
| } |
| 1135 |
1 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_lt function"); |
| 1136 |
|
| } |
| 1137 |
|
| |
| 1138 |
24595 |
| SV * _overload_gt(pTHX_ SV * a, SV * b, SV * third) { |
| 1139 |
|
| |
| 1140 |
24595 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
1 |
24594 |
24595 |
|
| 1141 |
1 |
▶ | if(SWITCH_ARGS) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) { |
1 |
0 |
1 |
|
| 1142 |
1 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < (D64)SvUVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < (D64)SvUVX(b)) return newSViv(1); |
0 |
1 |
1 |
|
| 1143 |
1 |
| return newSViv(0); |
| 1144 |
|
| } |
| 1145 |
0 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > (D64)SvUVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > (D64)SvUVX(b)) return newSViv(1); |
0 |
0 |
0 |
|
| 1146 |
0 |
| return newSViv(0); |
| 1147 |
|
| } |
| 1148 |
|
| |
| 1149 |
24594 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
24580 |
14 |
24594 |
|
| 1150 |
24580 |
▶ | if(SWITCH_ARGS) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) { |
2 |
24578 |
24580 |
|
| 1151 |
2 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < (D64)SvIVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < (D64)SvIVX(b)) return newSViv(1); |
2 |
0 |
2 |
|
| 1152 |
0 |
| return newSViv(0); |
| 1153 |
|
| } |
| 1154 |
24578 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > (D64)SvIVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > (D64)SvIVX(b)) return newSViv(1); |
19195 |
5383 |
24578 |
|
| 1155 |
5383 |
| return newSViv(0); |
| 1156 |
|
| } |
| 1157 |
|
| |
| 1158 |
14 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
4 |
10 |
14 |
| if(SvPOK(b) && !SvNOK(b)) { |
4 |
0 |
4 |
|
| 1159 |
4 |
▶ | if(SWITCH_ARGS) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) { |
1 |
3 |
4 |
|
| 1160 |
2 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
1 |
0 |
1 |
|
| 1161 |
0 |
| return newSViv(0); |
| 1162 |
|
| } |
| 1163 |
6 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
3 |
0 |
3 |
|
| 1164 |
0 |
| return newSViv(0); |
| 1165 |
|
| } |
| 1166 |
|
| |
| 1167 |
10 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
9 |
1 |
10 |
|
| 1168 |
9 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
9 |
0 |
9 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
9 |
0 |
9 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
9 |
9 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
9 |
0 |
9 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
9 |
9 |
|
| 1169 |
9 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
9 |
0 |
9 |
|
| 1170 |
9 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(1); |
8 |
1 |
9 |
|
| 1171 |
1 |
| return newSViv(0); |
| 1172 |
|
| } |
| 1173 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_gt function"); |
| 1174 |
|
| } |
| 1175 |
1 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_gt function"); |
| 1176 |
|
| } |
| 1177 |
|
| |
| 1178 |
25 |
| SV * _overload_lte(pTHX_ SV * a, SV * b, SV * third) { |
| 1179 |
|
| |
| 1180 |
25 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
2 |
23 |
25 |
|
| 1181 |
2 |
▶ | if(SWITCH_ARGS) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) { |
2 |
0 |
2 |
|
| 1182 |
2 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) >= (D64)SvUVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) >= (D64)SvUVX(b)) return newSViv(1); |
2 |
0 |
2 |
|
| 1183 |
0 |
| return newSViv(0); |
| 1184 |
|
| } |
| 1185 |
0 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) <= (D64)SvUVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) <= (D64)SvUVX(b)) return newSViv(1); |
0 |
0 |
0 |
|
| 1186 |
0 |
| return newSViv(0); |
| 1187 |
|
| } |
| 1188 |
|
| |
| 1189 |
23 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
5 |
18 |
23 |
|
| 1190 |
5 |
▶ | if(SWITCH_ARGS) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) { |
3 |
2 |
5 |
|
| 1191 |
3 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) >= (D64)SvIVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) >= (D64)SvIVX(b)) return newSViv(1); |
3 |
0 |
3 |
|
| 1192 |
0 |
| return newSViv(0); |
| 1193 |
|
| } |
| 1194 |
2 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) <= (D64)SvIVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) <= (D64)SvIVX(b)) return newSViv(1); |
2 |
0 |
2 |
|
| 1195 |
0 |
| return newSViv(0); |
| 1196 |
|
| } |
| 1197 |
|
| |
| 1198 |
18 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
4 |
14 |
18 |
| if(SvPOK(b) && !SvNOK(b)) { |
4 |
0 |
4 |
|
| 1199 |
4 |
▶ | if(SWITCH_ARGS) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) { |
2 |
2 |
4 |
|
| 1200 |
4 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) >= _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) >= _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
2 |
0 |
2 |
|
| 1201 |
0 |
| return newSViv(0); |
| 1202 |
|
| } |
| 1203 |
4 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) <= _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) <= _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
2 |
0 |
2 |
|
| 1204 |
0 |
| return newSViv(0); |
| 1205 |
|
| } |
| 1206 |
|
| |
| 1207 |
14 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
13 |
1 |
14 |
|
| 1208 |
13 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
13 |
0 |
13 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
13 |
0 |
13 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
13 |
13 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
13 |
0 |
13 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
13 |
13 |
|
| 1209 |
13 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
13 |
0 |
13 |
|
| 1210 |
13 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) <= *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) <= *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(1); |
12 |
1 |
13 |
|
| 1211 |
1 |
| return newSViv(0); |
| 1212 |
|
| } |
| 1213 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_lte function"); |
| 1214 |
|
| } |
| 1215 |
1 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_lte function"); |
| 1216 |
|
| } |
| 1217 |
|
| |
| 1218 |
78052 |
| SV * _overload_gte(pTHX_ SV * a, SV * b, SV * third) { |
| 1219 |
|
| |
| 1220 |
78052 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
2 |
78050 |
78052 |
|
| 1221 |
2 |
▶ | if(SWITCH_ARGS) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) { |
2 |
0 |
2 |
|
| 1222 |
2 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) <= (D64)SvUVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) <= (D64)SvUVX(b)) return newSViv(1); |
2 |
0 |
2 |
|
| 1223 |
0 |
| return newSViv(0); |
| 1224 |
|
| } |
| 1225 |
0 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) >= (D64)SvUVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) >= (D64)SvUVX(b)) return newSViv(1); |
0 |
0 |
0 |
|
| 1226 |
0 |
| return newSViv(0); |
| 1227 |
|
| } |
| 1228 |
|
| |
| 1229 |
78050 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
5 |
78045 |
78050 |
|
| 1230 |
5 |
▶ | if(SWITCH_ARGS) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) { |
3 |
2 |
5 |
|
| 1231 |
3 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) <= (D64)SvIVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) <= (D64)SvIVX(b)) return newSViv(1); |
3 |
0 |
3 |
|
| 1232 |
0 |
| return newSViv(0); |
| 1233 |
|
| } |
| 1234 |
2 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) >= (D64)SvIVX(b)) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) >= (D64)SvIVX(b)) return newSViv(1); |
2 |
0 |
2 |
|
| 1235 |
0 |
| return newSViv(0); |
| 1236 |
|
| } |
| 1237 |
|
| |
| 1238 |
78045 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
4 |
78041 |
78045 |
| if(SvPOK(b) && !SvNOK(b)) { |
4 |
0 |
4 |
|
| 1239 |
4 |
▶ | if(SWITCH_ARGS) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) { |
2 |
2 |
4 |
|
| 1240 |
4 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) <= _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) <= _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
2 |
0 |
2 |
|
| 1241 |
0 |
| return newSViv(0); |
| 1242 |
|
| } |
| 1243 |
4 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) >= _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) >= _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1); |
2 |
0 |
2 |
|
| 1244 |
0 |
| return newSViv(0); |
| 1245 |
|
| } |
| 1246 |
|
| |
| 1247 |
78041 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
78040 |
1 |
78041 |
|
| 1248 |
78040 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
78040 |
0 |
78040 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
78040 |
0 |
78040 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
78040 |
78040 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
78040 |
0 |
78040 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
78040 |
78040 |
|
| 1249 |
78040 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
78040 |
0 |
78040 |
|
| 1250 |
78040 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) >= *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) >= *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(1); |
58846 |
19194 |
78040 |
|
| 1251 |
19194 |
| return newSViv(0); |
| 1252 |
|
| } |
| 1253 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_gte function"); |
| 1254 |
|
| } |
| 1255 |
1 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_gte function"); |
| 1256 |
|
| } |
| 1257 |
|
| |
| 1258 |
45 |
| SV * _overload_spaceship(pTHX_ SV * a, SV * b, SV * third) { |
| 1259 |
45 |
| int reversal = 1; |
| 1260 |
45 |
▶ | if(SWITCH_ARGS) reversal = -1; |
Branch: 1 branch
| Branch | True | False | Total |
| if(SWITCH_ARGS) reversal = -1; |
16 |
29 |
45 |
|
| 1261 |
|
| |
| 1262 |
45 |
▶ | if(SvUOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(b)) { |
5 |
40 |
45 |
|
| 1263 |
5 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > (D64)SvUVX(b)) return newSViv(1 * reversal); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > (D64)SvUVX(b)) return newSViv(1 * reversal); |
0 |
5 |
5 |
|
| 1264 |
5 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < (D64)SvUVX(b)) return newSViv(-1 * reversal); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < (D64)SvUVX(b)) return newSViv(-1 * reversal); |
0 |
5 |
5 |
|
| 1265 |
5 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == (D64)SvUVX(b)) return newSViv(0); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == (D64)SvUVX(b)) return newSViv(0); |
4 |
1 |
5 |
|
| 1266 |
1 |
| return &PL_sv_undef; /* Math::Decimal64 object (1st arg) is a nan */ |
| 1267 |
|
| } |
| 1268 |
|
| |
| 1269 |
40 |
▶ | if(SvIOK(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(b)) { |
11 |
29 |
40 |
|
| 1270 |
11 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > (D64)SvIVX(b)) return newSViv(1 * reversal); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > (D64)SvIVX(b)) return newSViv(1 * reversal); |
2 |
9 |
11 |
|
| 1271 |
9 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < (D64)SvIVX(b)) return newSViv(-1 * reversal); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < (D64)SvIVX(b)) return newSViv(-1 * reversal); |
4 |
5 |
9 |
|
| 1272 |
5 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == (D64)SvIVX(b)) return newSViv(0); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == (D64)SvIVX(b)) return newSViv(0); |
3 |
2 |
5 |
|
| 1273 |
2 |
| return &PL_sv_undef; /* Math::Decimal64 object (1st arg) is a nan */ |
| 1274 |
|
| } |
| 1275 |
|
| |
| 1276 |
29 |
▶ | if(SvPOK(b) && !SvNOK(b)) { |
Branch: 2 branches
| Branch | True | False | Total |
| if(SvPOK(b) && !SvNOK(b)) { |
9 |
20 |
29 |
| if(SvPOK(b) && !SvNOK(b)) { |
9 |
0 |
9 |
|
| 1277 |
18 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1 * reversal); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(1 * reversal); |
2 |
7 |
9 |
|
| 1278 |
14 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(-1 * reversal); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(-1 * reversal); |
2 |
5 |
7 |
|
| 1279 |
10 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(0); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == _atodecimal(aTHX_ SvPV_nolen(b))) return newSViv(0); |
3 |
2 |
5 |
|
| 1280 |
2 |
| return &PL_sv_undef; /* Math::Decimal64 object (1st arg) is a nan */ |
| 1281 |
|
| } |
| 1282 |
|
| |
| 1283 |
20 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
19 |
1 |
20 |
|
| 1284 |
19 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
19 |
0 |
19 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
19 |
0 |
19 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
19 |
19 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
19 |
0 |
19 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
19 |
19 |
|
| 1285 |
19 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
19 |
0 |
19 |
|
| 1286 |
19 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(-1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) < *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(-1); |
4 |
15 |
19 |
|
| 1287 |
15 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) > *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(1); |
4 |
11 |
15 |
|
| 1288 |
11 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(0); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) == *(INT2PTR(_Decimal64 *, SvIVX(SvRV(b))))) return newSViv(0); |
6 |
5 |
11 |
|
| 1289 |
5 |
| return &PL_sv_undef; /* it's a nan */ |
| 1290 |
|
| } |
| 1291 |
0 |
| croak("Invalid object supplied to Math::Decimal64::_overload_spaceship function"); |
| 1292 |
|
| } |
| 1293 |
1 |
| croak("Invalid argument supplied to Math::Decimal64::_overload_spaceship function"); |
| 1294 |
|
| } |
| 1295 |
|
| |
| 1296 |
3060 |
| SV * _overload_copy(pTHX_ SV * a, SV * b, SV * third) { |
| 1297 |
|
| |
| 1298 |
|
| _Decimal64 * d64; |
| 1299 |
|
| SV * obj_ref, * obj; |
| 1300 |
|
| |
| 1301 |
3060 |
| Newx(d64, 1, _Decimal64); |
| 1302 |
3060 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in _overload_copy function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in _overload_copy function"); |
0 |
3060 |
3060 |
|
| 1303 |
|
| |
| 1304 |
3060 |
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
| 1305 |
|
| |
| 1306 |
3060 |
| obj_ref = newSV(0); |
| 1307 |
3060 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 1308 |
3060 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 1309 |
3060 |
| SvREADONLY_on(obj); |
| 1310 |
3060 |
| return obj_ref; |
| 1311 |
|
| } |
| 1312 |
|
| |
| 1313 |
25 |
| SV * D64toD64(pTHX_ SV * a) { |
| 1314 |
|
| _Decimal64 * d64; |
| 1315 |
|
| SV * obj_ref, * obj; |
| 1316 |
|
| |
| 1317 |
25 |
▶ | if(sv_isobject(a)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(a)) { |
25 |
0 |
25 |
|
| 1318 |
25 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(a))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(a))); |
25 |
0 |
25 |
| const char *h = HvNAME(SvSTASH(SvRV(a))); |
25 |
0 |
25 |
| const char *h = HvNAME(SvSTASH(SvRV(a))); |
0 |
25 |
25 |
| const char *h = HvNAME(SvSTASH(SvRV(a))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(a))); |
25 |
0 |
25 |
| const char *h = HvNAME(SvSTASH(SvRV(a))); |
0 |
25 |
25 |
|
| 1319 |
25 |
▶ | if(strEQ(h, "Math::Decimal64")) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) { |
25 |
0 |
25 |
|
| 1320 |
|
| |
| 1321 |
25 |
| Newx(d64, 1, _Decimal64); |
| 1322 |
25 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in D64toD64 function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in D64toD64 function"); |
0 |
25 |
25 |
|
| 1323 |
|
| |
| 1324 |
25 |
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
| 1325 |
|
| |
| 1326 |
25 |
| obj_ref = newSV(0); |
| 1327 |
25 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 1328 |
25 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 1329 |
25 |
| SvREADONLY_on(obj); |
| 1330 |
25 |
| return obj_ref; |
| 1331 |
|
| } |
| 1332 |
0 |
| croak("Invalid object supplied to Math::Decimal64::D64toD64 function"); |
| 1333 |
|
| } |
| 1334 |
0 |
| croak("Invalid argument supplied to Math::Decimal64::D64toD64 function"); |
| 1335 |
|
| } |
| 1336 |
|
| |
| 1337 |
6 |
| SV * _overload_true(pTHX_ SV * a, SV * b, SV * third) { |
| 1338 |
|
| |
| 1339 |
6 |
▶ | if(_is_nan(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))))) return newSViv(0); |
Branch: 1 branch
| Branch | True | False | Total |
| if(_is_nan(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))))) return newSViv(0); |
2 |
4 |
6 |
|
| 1340 |
4 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) != 0.0DD) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) != 0.0DD) return newSViv(1); |
3 |
1 |
4 |
|
| 1341 |
1 |
| return newSViv(0); |
| 1342 |
|
| } |
| 1343 |
|
| |
| 1344 |
62 |
| SV * _overload_not(pTHX_ SV * a, SV * b, SV * third) { |
| 1345 |
62 |
▶ | if(_is_nan(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))))) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(_is_nan(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))))) return newSViv(1); |
1 |
61 |
62 |
|
| 1346 |
61 |
▶ | if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) != 0.0DD) return newSViv(0); |
Branch: 1 branch
| Branch | True | False | Total |
| if(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))) != 0.0DD) return newSViv(0); |
45 |
16 |
61 |
|
| 1347 |
16 |
| return newSViv(1); |
| 1348 |
|
| } |
| 1349 |
|
| |
| 1350 |
2 |
| SV * _overload_abs(pTHX_ SV * a, SV * b, SV * third) { |
| 1351 |
|
| |
| 1352 |
|
| _Decimal64 * d64; |
| 1353 |
|
| SV * obj_ref, * obj; |
| 1354 |
|
| |
| 1355 |
2 |
| Newx(d64, 1, _Decimal64); |
| 1356 |
2 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in _overload_abs function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in _overload_abs function"); |
0 |
2 |
2 |
|
| 1357 |
|
| |
| 1358 |
2 |
| obj_ref = newSV(0); |
| 1359 |
2 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 1360 |
|
| |
| 1361 |
2 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 1362 |
2 |
| SvREADONLY_on(obj); |
| 1363 |
|
| |
| 1364 |
2 |
| *d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(a)))); |
| 1365 |
2 |
▶ | if(_is_neg_zero(*d64) || *d64 < 0 ) *d64 *= -1.0DD; |
Branch: 2 branches
| Branch | True | False | Total |
| if(_is_neg_zero(*d64) || *d64 < 0 ) *d64 *= -1.0DD; |
1 |
1 |
2 |
| if(_is_neg_zero(*d64) || *d64 < 0 ) *d64 *= -1.0DD; |
1 |
0 |
1 |
|
| 1366 |
2 |
| return obj_ref; |
| 1367 |
|
| } |
| 1368 |
|
| |
| 1369 |
1 |
| SV * _overload_inc(pTHX_ SV * p, SV * second, SV * third) { |
| 1370 |
1 |
| SvREFCNT_inc(p); |
| 1371 |
1 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(p)))) += 1.0DD; |
| 1372 |
1 |
| return p; |
| 1373 |
|
| } |
| 1374 |
|
| |
| 1375 |
1 |
| SV * _overload_dec(pTHX_ SV * p, SV * second, SV * third) { |
| 1376 |
1 |
| SvREFCNT_inc(p); |
| 1377 |
1 |
| *(INT2PTR(_Decimal64 *, SvIVX(SvRV(p)))) -= 1.0DD; |
| 1378 |
1 |
| return p; |
| 1379 |
|
| } |
| 1380 |
|
| |
| 1381 |
146 |
| SV * _itsa(pTHX_ SV * a) { |
| 1382 |
146 |
▶ | if(SvUOK(a)) return newSVuv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvUOK(a)) return newSVuv(1); |
14 |
132 |
146 |
|
| 1383 |
132 |
▶ | if(SvIOK(a)) return newSVuv(2); |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIOK(a)) return newSVuv(2); |
17 |
115 |
132 |
|
| 1384 |
115 |
▶ | if(SvNOK(a)) return newSVuv(3); |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvNOK(a)) return newSVuv(3); |
4 |
111 |
115 |
|
| 1385 |
111 |
▶ | if(SvPOK(a)) return newSVuv(4); |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvPOK(a)) return newSVuv(4); |
73 |
38 |
111 |
|
| 1386 |
38 |
▶ | if(sv_isobject(a)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(a)) { |
38 |
0 |
38 |
|
| 1387 |
38 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(a))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(a))); |
38 |
0 |
38 |
| const char *h = HvNAME(SvSTASH(SvRV(a))); |
38 |
0 |
38 |
| const char *h = HvNAME(SvSTASH(SvRV(a))); |
0 |
38 |
38 |
| const char *h = HvNAME(SvSTASH(SvRV(a))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(a))); |
38 |
0 |
38 |
| const char *h = HvNAME(SvSTASH(SvRV(a))); |
0 |
38 |
38 |
|
| 1388 |
38 |
▶ | if(strEQ(h, "Math::Decimal64")) return newSVuv(64); |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) return newSVuv(64); |
34 |
4 |
38 |
|
| 1389 |
|
| } |
| 1390 |
4 |
| return newSVuv(0); |
| 1391 |
|
| } |
| 1392 |
|
| |
| 1393 |
48167 |
| SV * is_NaND64(pTHX_ SV * b) { |
| 1394 |
48167 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
48167 |
0 |
48167 |
|
| 1395 |
48167 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
48167 |
0 |
48167 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
48167 |
0 |
48167 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
48167 |
48167 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
48167 |
0 |
48167 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
48167 |
48167 |
|
| 1396 |
48167 |
▶ | if(strEQ(h, "Math::Decimal64")) |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) |
48167 |
0 |
48167 |
|
| 1397 |
48167 |
| return newSViv(_is_nan(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(b)))))); |
| 1398 |
|
| } |
| 1399 |
0 |
| croak("Invalid argument supplied to Math::Decimal64::is_NaND64 function"); |
| 1400 |
|
| } |
| 1401 |
|
| |
| 1402 |
48244 |
| SV * is_InfD64(pTHX_ SV * b) { |
| 1403 |
48244 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
48244 |
0 |
48244 |
|
| 1404 |
48244 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
48244 |
0 |
48244 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
48244 |
0 |
48244 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
48244 |
48244 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
48244 |
0 |
48244 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
48244 |
48244 |
|
| 1405 |
48244 |
▶ | if(strEQ(h, "Math::Decimal64")) |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) |
48244 |
0 |
48244 |
|
| 1406 |
48244 |
| return newSViv(_is_inf(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(b)))))); |
| 1407 |
|
| } |
| 1408 |
0 |
| croak("Invalid argument supplied to Math::Decimal64::is_InfD64 function"); |
| 1409 |
|
| } |
| 1410 |
|
| |
| 1411 |
226372 |
| SV * is_ZeroD64(pTHX_ SV * b) { |
| 1412 |
226372 |
▶ | if(sv_isobject(b)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if(sv_isobject(b)) { |
226372 |
0 |
226372 |
|
| 1413 |
226372 |
▶ | const char *h = HvNAME(SvSTASH(SvRV(b))); |
Branch: 6 branches
| Branch | True | False | Total |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
226372 |
0 |
226372 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
226372 |
0 |
226372 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
226372 |
226372 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
0 |
0 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
226372 |
0 |
226372 |
| const char *h = HvNAME(SvSTASH(SvRV(b))); |
0 |
226372 |
226372 |
|
| 1414 |
226372 |
▶ | if(strEQ(h, "Math::Decimal64")) |
Branch: 1 branch
| Branch | True | False | Total |
| if(strEQ(h, "Math::Decimal64")) |
226372 |
0 |
226372 |
|
| 1415 |
226372 |
▶ | if (_is_neg_zero(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(b)))))) return newSViv(-1); |
Branch: 1 branch
| Branch | True | False | Total |
| if (_is_neg_zero(*(INT2PTR(_Decimal64 *, SvIVX(SvRV(b)))))) return newSViv(-1); |
656 |
225716 |
226372 |
|
| 1416 |
225716 |
▶ | if (*(INT2PTR(_Decimal64 *, SvIVX(SvRV(b)))) == 0.0DD) return newSViv(1); |
Branch: 1 branch
| Branch | True | False | Total |
| if (*(INT2PTR(_Decimal64 *, SvIVX(SvRV(b)))) == 0.0DD) return newSViv(1); |
504 |
225212 |
225716 |
|
| 1417 |
225212 |
| return newSViv(0); |
| 1418 |
|
| } |
| 1419 |
0 |
| croak("Invalid argument supplied to Math::Decimal64::is_ZeroD64 function"); |
| 1420 |
|
| } |
| 1421 |
|
| |
| 1422 |
0 |
| SV * _wrap_count(pTHX) { |
| 1423 |
0 |
| return newSVuv(PL_sv_count); |
| 1424 |
|
| } |
| 1425 |
|
| |
| 1426 |
1 |
| SV * _get_xs_version(pTHX) { |
| 1427 |
1 |
| return newSVpv(XS_VERSION, 0); |
| 1428 |
|
| } |
| 1429 |
|
| |
| 1430 |
183975 |
| void _d64_bytes(pTHX_ SV * sv) { |
| 1431 |
183975 |
| dXSARGS; |
| 1432 |
183975 |
| _Decimal64 d64 = *(INT2PTR(_Decimal64 *, SvIVX(SvRV(sv)))); |
| 1433 |
183975 |
| int i, n = sizeof(_Decimal64); |
| 1434 |
|
| char buff[4]; |
| 1435 |
183975 |
| void * p = &d64; |
| 1436 |
|
| |
| 1437 |
183975 |
| sp = mark; |
| 1438 |
|
| |
| 1439 |
|
| #ifdef WE_HAVE_BENDIAN /* Big Endian architecture */ |
| 1440 |
|
| for (i = 0; i < n; i++) { |
| 1441 |
|
| #else |
| 1442 |
1655775 |
▶ | for (i = n - 1; i >= 0; i--) { |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = n - 1; i >= 0; i--) { |
1471800 |
183975 |
1655775 |
|
| 1443 |
|
| #endif |
| 1444 |
|
| |
| 1445 |
1471800 |
| sprintf(buff, "%02X", ((unsigned char*)p)[i]); |
| 1446 |
1471800 |
▶ | XPUSHs(sv_2mortal(newSVpv(buff, 0))); |
Branch: 1 branch
| Branch | True | False | Total |
| XPUSHs(sv_2mortal(newSVpv(buff, 0))); |
0 |
1471800 |
1471800 |
|
| 1447 |
|
| } |
| 1448 |
183975 |
| PUTBACK; |
| 1449 |
183975 |
| XSRETURN(n); |
| 1450 |
|
| } |
| 1451 |
|
| |
| 1452 |
180777 |
| void _bid_mant(pTHX_ SV * bin) { |
| 1453 |
180777 |
| dXSARGS; |
| 1454 |
180777 |
| int i, imax = av_len((AV*)SvRV(bin)); |
| 1455 |
|
| char buf[21]; |
| 1456 |
180777 |
| long long val = 0ll; |
| 1457 |
|
| extern long long add_on[54]; |
| 1458 |
|
| |
| 1459 |
9942735 |
▶ | for(i = 0; i <= imax; i++) |
Branch: 1 branch
| Branch | True | False | Total |
| for(i = 0; i <= imax; i++) |
9761958 |
180777 |
9942735 |
|
| 1460 |
9761958 |
▶ | if(SvIV(*(av_fetch((AV*)SvRV(bin), i, 0)))) val += add_on[i]; |
Branch: 1 branch
| Branch | True | False | Total |
| if(SvIV(*(av_fetch((AV*)SvRV(bin), i, 0)))) val += add_on[i]; |
3245884 |
6516074 |
9761958 |
|
| 1461 |
|
| |
| 1462 |
180777 |
▶ | if(val > 9999999999999999ll) sprintf(buf, "%lld", 0ll); |
Branch: 1 branch
| Branch | True | False | Total |
| if(val > 9999999999999999ll) sprintf(buf, "%lld", 0ll); |
0 |
180777 |
180777 |
|
| 1463 |
180777 |
| else sprintf(buf, "%lld", val); |
| 1464 |
|
| |
| 1465 |
180777 |
| ST(0) = sv_2mortal(newSVpv(buf, 0)); |
| 1466 |
180777 |
| XSRETURN(1); |
| 1467 |
|
| |
| 1468 |
|
| } |
| 1469 |
|
| |
| 1470 |
1 |
| SV * _endianness(pTHX) { |
| 1471 |
|
| #if defined(WE_HAVE_BENDIAN) |
| 1472 |
|
| return newSVpv("Big Endian", 0); |
| 1473 |
|
| #elif defined(WE_HAVE_LENDIAN) |
| 1474 |
1 |
| return newSVpv("Little Endian", 0); |
| 1475 |
|
| #else |
| 1476 |
|
| return &PL_sv_undef; |
| 1477 |
|
| #endif |
| 1478 |
|
| } |
| 1479 |
|
| |
| 1480 |
6 |
| SV * _DPDtoD64(pTHX_ char * in) { |
| 1481 |
|
| D64 * d64; |
| 1482 |
|
| SV * obj_ref, * obj; |
| 1483 |
6 |
| int i, n = sizeof(D64); |
| 1484 |
6 |
| D64 out = 0.; |
| 1485 |
6 |
| void *p = &out; |
| 1486 |
|
| |
| 1487 |
6 |
| Newx(d64, 1, D64); |
| 1488 |
6 |
▶ | if(d64 == NULL) croak("Failed to allocate memory in DPDtoD64 function"); |
Branch: 1 branch
| Branch | True | False | Total |
| if(d64 == NULL) croak("Failed to allocate memory in DPDtoD64 function"); |
0 |
6 |
6 |
|
| 1489 |
|
| |
| 1490 |
6 |
| obj_ref = newSV(0); |
| 1491 |
6 |
| obj = newSVrv(obj_ref, "Math::Decimal64"); |
| 1492 |
|
| |
| 1493 |
54 |
▶ | for (i = n - 1; i >= 0; i--) |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = n - 1; i >= 0; i--) |
48 |
6 |
54 |
|
| 1494 |
|
| #ifdef WE_HAVE_BENDIAN |
| 1495 |
|
| ((unsigned char*)p)[i] = in[i]; |
| 1496 |
|
| #else |
| 1497 |
48 |
| ((unsigned char*)p)[i] = in[n - 1 - i]; |
| 1498 |
|
| #endif |
| 1499 |
|
| |
| 1500 |
6 |
| *d64 = out; |
| 1501 |
|
| |
| 1502 |
6 |
| sv_setiv(obj, INT2PTR(IV,d64)); |
| 1503 |
6 |
| SvREADONLY_on(obj); |
| 1504 |
6 |
| return obj_ref; |
| 1505 |
|
| } |
| 1506 |
|
| |
| 1507 |
|
| /* |
| 1508 |
|
| _assignDPD takes 2 args: a Math::Decimal64 object, and a |
| 1509 |
|
| string that encodes the value to be assigned to that object |
| 1510 |
|
| */ |
| 1511 |
6 |
| void _assignDPD(pTHX_ SV * a, char * in) { |
| 1512 |
6 |
| int i, n = sizeof(D64); |
| 1513 |
6 |
| D64 out = 0.; |
| 1514 |
6 |
| void *p = &out; |
| 1515 |
|
| |
| 1516 |
54 |
▶ | for (i = n - 1; i >= 0; i--) |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = n - 1; i >= 0; i--) |
48 |
6 |
54 |
|
| 1517 |
|
| #ifdef WE_HAVE_BENDIAN |
| 1518 |
|
| ((unsigned char*)p)[i] = in[i]; |
| 1519 |
|
| #else |
| 1520 |
48 |
| ((unsigned char*)p)[i] = in[n - 1 - i]; |
| 1521 |
|
| #endif |
| 1522 |
|
| |
| 1523 |
6 |
| *(INT2PTR(D64 *, SvIVX(SvRV(a)))) = out; |
| 1524 |
6 |
| } |
| 1525 |
|
| |
| 1526 |
19 |
| int nnumflag(void) { |
| 1527 |
19 |
| return nnum; |
| 1528 |
|
| } |
| 1529 |
|
| |
| 1530 |
1 |
| void clear_nnum(void) { |
| 1531 |
1 |
| nnum = 0; |
| 1532 |
1 |
| } |
| 1533 |
|
| |
| 1534 |
1 |
| void set_nnum(int x) { |
| 1535 |
1 |
| nnum = x; |
| 1536 |
1 |
| } |
| 1537 |
|
| |
| 1538 |
0 |
| int _lln(pTHX_ SV * x) { |
| 1539 |
0 |
▶ | if(looks_like_number(x)) return 1; |
Branch: 1 branch
| Branch | True | False | Total |
| if(looks_like_number(x)) return 1; |
0 |
0 |
0 |
|
| 1540 |
0 |
| return 0; |
| 1541 |
|
| } |
| 1542 |
|
| |
| 1543 |
|
| MODULE = Math::Decimal64 PACKAGE = Math::Decimal64 |
| 1544 |
|
| |
| 1545 |
|
| PROTOTYPES: DISABLE |
| 1546 |
|
| |
| 1547 |
|
| |
| 1548 |
|
| SV * |
| 1549 |
|
| _is_nan_NV (x) |
| 1550 |
|
| SV * x |
| 1551 |
|
| CODE: |
| 1552 |
0 |
| RETVAL = _is_nan_NV (aTHX_ x); |
| 1553 |
|
| OUTPUT: RETVAL |
| 1554 |
|
| |
| 1555 |
|
| SV * |
| 1556 |
|
| _is_inf_NV (x) |
| 1557 |
|
| SV * x |
| 1558 |
|
| CODE: |
| 1559 |
0 |
| RETVAL = _is_inf_NV (aTHX_ x); |
| 1560 |
|
| OUTPUT: RETVAL |
| 1561 |
|
| |
| 1562 |
|
| SV * |
| 1563 |
|
| _is_neg_zero_NV (x) |
| 1564 |
|
| SV * x |
| 1565 |
|
| CODE: |
| 1566 |
0 |
| RETVAL = _is_neg_zero_NV (aTHX_ x); |
| 1567 |
|
| OUTPUT: RETVAL |
| 1568 |
|
| |
| 1569 |
|
| SV * |
| 1570 |
|
| _DEC64_MAX () |
| 1571 |
|
| CODE: |
| 1572 |
8 |
| RETVAL = _DEC64_MAX (aTHX); |
| 1573 |
|
| OUTPUT: RETVAL |
| 1574 |
|
| |
| 1575 |
|
| |
| 1576 |
|
| SV * |
| 1577 |
|
| _DEC64_MIN () |
| 1578 |
|
| CODE: |
| 1579 |
9 |
| RETVAL = _DEC64_MIN (aTHX); |
| 1580 |
|
| OUTPUT: RETVAL |
| 1581 |
|
| |
| 1582 |
|
| |
| 1583 |
|
| SV * |
| 1584 |
|
| NaND64 () |
| 1585 |
|
| CODE: |
| 1586 |
28 |
| RETVAL = NaND64 (aTHX); |
| 1587 |
|
| OUTPUT: RETVAL |
| 1588 |
|
| |
| 1589 |
|
| |
| 1590 |
|
| SV * |
| 1591 |
|
| InfD64 (sign) |
| 1592 |
|
| int sign |
| 1593 |
|
| CODE: |
| 1594 |
18 |
| RETVAL = InfD64 (aTHX_ sign); |
| 1595 |
|
| OUTPUT: RETVAL |
| 1596 |
|
| |
| 1597 |
|
| SV * |
| 1598 |
|
| ZeroD64 (sign) |
| 1599 |
|
| int sign |
| 1600 |
|
| CODE: |
| 1601 |
47780 |
| RETVAL = ZeroD64 (aTHX_ sign); |
| 1602 |
|
| OUTPUT: RETVAL |
| 1603 |
|
| |
| 1604 |
|
| SV * |
| 1605 |
|
| UnityD64 (sign) |
| 1606 |
|
| int sign |
| 1607 |
|
| CODE: |
| 1608 |
782 |
| RETVAL = UnityD64 (aTHX_ sign); |
| 1609 |
|
| OUTPUT: RETVAL |
| 1610 |
|
| |
| 1611 |
|
| SV * |
| 1612 |
|
| Exp10 (power) |
| 1613 |
|
| int power |
| 1614 |
|
| CODE: |
| 1615 |
1543 |
| RETVAL = Exp10 (aTHX_ power); |
| 1616 |
|
| OUTPUT: RETVAL |
| 1617 |
|
| |
| 1618 |
|
| SV * |
| 1619 |
|
| _testvalD64 (sign) |
| 1620 |
|
| int sign |
| 1621 |
|
| CODE: |
| 1622 |
3 |
| RETVAL = _testvalD64 (aTHX_ sign); |
| 1623 |
|
| OUTPUT: RETVAL |
| 1624 |
|
| |
| 1625 |
|
| SV * |
| 1626 |
|
| _MEtoD64 (mantissa, exponent) |
| 1627 |
|
| char * mantissa |
| 1628 |
|
| SV * exponent |
| 1629 |
|
| CODE: |
| 1630 |
546896 |
| RETVAL = _MEtoD64 (aTHX_ mantissa, exponent); |
| 1631 |
|
| OUTPUT: RETVAL |
| 1632 |
|
| |
| 1633 |
|
| SV * |
| 1634 |
|
| NVtoD64 (x) |
| 1635 |
|
| SV * x |
| 1636 |
|
| CODE: |
| 1637 |
65 |
| RETVAL = NVtoD64 (aTHX_ x); |
| 1638 |
|
| OUTPUT: RETVAL |
| 1639 |
|
| |
| 1640 |
|
| SV * |
| 1641 |
|
| UVtoD64 (x) |
| 1642 |
|
| SV * x |
| 1643 |
|
| CODE: |
| 1644 |
17 |
| RETVAL = UVtoD64 (aTHX_ x); |
| 1645 |
|
| OUTPUT: RETVAL |
| 1646 |
|
| |
| 1647 |
|
| SV * |
| 1648 |
|
| IVtoD64 (x) |
| 1649 |
|
| SV * x |
| 1650 |
|
| CODE: |
| 1651 |
19 |
| RETVAL = IVtoD64 (aTHX_ x); |
| 1652 |
|
| OUTPUT: RETVAL |
| 1653 |
|
| |
| 1654 |
|
| SV * |
| 1655 |
|
| PVtoD64 (x) |
| 1656 |
|
| char * x |
| 1657 |
|
| CODE: |
| 1658 |
17539 |
| RETVAL = PVtoD64 (aTHX_ x); |
| 1659 |
|
| OUTPUT: RETVAL |
| 1660 |
|
| |
| 1661 |
|
| SV * |
| 1662 |
|
| STRtoD64 (x) |
| 1663 |
|
| char * x |
| 1664 |
|
| CODE: |
| 1665 |
1 |
| RETVAL = STRtoD64 (aTHX_ x); |
| 1666 |
|
| OUTPUT: RETVAL |
| 1667 |
|
| |
| 1668 |
|
| int |
| 1669 |
|
| have_strtod64 () |
| 1670 |
|
| |
| 1671 |
|
| |
| 1672 |
|
| SV * |
| 1673 |
|
| D64toNV (d64) |
| 1674 |
|
| SV * d64 |
| 1675 |
|
| CODE: |
| 1676 |
3 |
| RETVAL = D64toNV (aTHX_ d64); |
| 1677 |
|
| OUTPUT: RETVAL |
| 1678 |
|
| |
| 1679 |
|
| void |
| 1680 |
|
| LDtoD64 (d64, ld) |
| 1681 |
|
| SV * d64 |
| 1682 |
|
| SV * ld |
| 1683 |
|
| PREINIT: |
| 1684 |
|
| I32* temp; |
| 1685 |
|
| PPCODE: |
| 1686 |
0 |
| temp = PL_markstack_ptr++; |
| 1687 |
0 |
| LDtoD64(aTHX_ d64, ld); |
| 1688 |
0 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
0 |
0 |
0 |
|
| 1689 |
|
| /* truly void, because dXSARGS not invoked */ |
| 1690 |
0 |
| PL_markstack_ptr = temp; |
| 1691 |
0 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 1692 |
|
| } |
| 1693 |
|
| /* must have used dXSARGS; list context implied */ |
| 1694 |
0 |
| return; /* assume stack size is correct */ |
| 1695 |
|
| |
| 1696 |
|
| void |
| 1697 |
|
| D64toLD (ld, d64) |
| 1698 |
|
| SV * ld |
| 1699 |
|
| SV * d64 |
| 1700 |
|
| PREINIT: |
| 1701 |
|
| I32* temp; |
| 1702 |
|
| PPCODE: |
| 1703 |
0 |
| temp = PL_markstack_ptr++; |
| 1704 |
0 |
| D64toLD(aTHX_ ld, d64); |
| 1705 |
0 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
0 |
0 |
0 |
|
| 1706 |
|
| /* truly void, because dXSARGS not invoked */ |
| 1707 |
0 |
| PL_markstack_ptr = temp; |
| 1708 |
0 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 1709 |
|
| } |
| 1710 |
|
| /* must have used dXSARGS; list context implied */ |
| 1711 |
0 |
| return; /* assume stack size is correct */ |
| 1712 |
|
| |
| 1713 |
|
| void |
| 1714 |
|
| DESTROY (rop) |
| 1715 |
|
| SV * rop |
| 1716 |
|
| PREINIT: |
| 1717 |
|
| I32* temp; |
| 1718 |
|
| PPCODE: |
| 1719 |
618765 |
| temp = PL_markstack_ptr++; |
| 1720 |
618765 |
| DESTROY(aTHX_ rop); |
| 1721 |
618765 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
618765 |
0 |
618765 |
|
| 1722 |
|
| /* truly void, because dXSARGS not invoked */ |
| 1723 |
618765 |
| PL_markstack_ptr = temp; |
| 1724 |
618765 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 1725 |
|
| } |
| 1726 |
|
| /* must have used dXSARGS; list context implied */ |
| 1727 |
0 |
| return; /* assume stack size is correct */ |
| 1728 |
|
| |
| 1729 |
|
| void |
| 1730 |
|
| _assignME (a, mantissa, c) |
| 1731 |
|
| SV * a |
| 1732 |
|
| char * mantissa |
| 1733 |
|
| SV * c |
| 1734 |
|
| PREINIT: |
| 1735 |
|
| I32* temp; |
| 1736 |
|
| PPCODE: |
| 1737 |
8 |
| temp = PL_markstack_ptr++; |
| 1738 |
8 |
| _assignME(aTHX_ a, mantissa, c); |
| 1739 |
8 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
8 |
0 |
8 |
|
| 1740 |
|
| /* truly void, because dXSARGS not invoked */ |
| 1741 |
8 |
| PL_markstack_ptr = temp; |
| 1742 |
8 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 1743 |
|
| } |
| 1744 |
|
| /* must have used dXSARGS; list context implied */ |
| 1745 |
0 |
| return; /* assume stack size is correct */ |
| 1746 |
|
| |
| 1747 |
|
| void |
| 1748 |
|
| assignPV (a, s) |
| 1749 |
|
| SV * a |
| 1750 |
|
| char * s |
| 1751 |
|
| PREINIT: |
| 1752 |
|
| I32* temp; |
| 1753 |
|
| PPCODE: |
| 1754 |
12111 |
| temp = PL_markstack_ptr++; |
| 1755 |
12111 |
| assignPV(aTHX_ a, s); |
| 1756 |
12111 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
12111 |
0 |
12111 |
|
| 1757 |
|
| /* truly void, because dXSARGS not invoked */ |
| 1758 |
12111 |
| PL_markstack_ptr = temp; |
| 1759 |
12111 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 1760 |
|
| } |
| 1761 |
|
| /* must have used dXSARGS; list context implied */ |
| 1762 |
0 |
| return; /* assume stack size is correct */ |
| 1763 |
|
| |
| 1764 |
|
| void |
| 1765 |
|
| assignIV (a, val) |
| 1766 |
|
| SV * a |
| 1767 |
|
| SV * val |
| 1768 |
|
| PREINIT: |
| 1769 |
|
| I32* temp; |
| 1770 |
|
| PPCODE: |
| 1771 |
2 |
| temp = PL_markstack_ptr++; |
| 1772 |
2 |
| assignIV(aTHX_ a, val); |
| 1773 |
2 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
2 |
0 |
2 |
|
| 1774 |
|
| /* truly void, because dXSARGS not invoked */ |
| 1775 |
2 |
| PL_markstack_ptr = temp; |
| 1776 |
2 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 1777 |
|
| } |
| 1778 |
|
| /* must have used dXSARGS; list context implied */ |
| 1779 |
0 |
| return; /* assume stack size is correct */ |
| 1780 |
|
| |
| 1781 |
|
| void |
| 1782 |
|
| assignUV (a, val) |
| 1783 |
|
| SV * a |
| 1784 |
|
| SV * val |
| 1785 |
|
| PREINIT: |
| 1786 |
|
| I32* temp; |
| 1787 |
|
| PPCODE: |
| 1788 |
1 |
| temp = PL_markstack_ptr++; |
| 1789 |
1 |
| assignUV(aTHX_ a, val); |
| 1790 |
1 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
1 |
0 |
1 |
|
| 1791 |
|
| /* truly void, because dXSARGS not invoked */ |
| 1792 |
1 |
| PL_markstack_ptr = temp; |
| 1793 |
1 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 1794 |
|
| } |
| 1795 |
|
| /* must have used dXSARGS; list context implied */ |
| 1796 |
0 |
| return; /* assume stack size is correct */ |
| 1797 |
|
| |
| 1798 |
|
| void |
| 1799 |
|
| assignNV (a, val) |
| 1800 |
|
| SV * a |
| 1801 |
|
| SV * val |
| 1802 |
|
| PREINIT: |
| 1803 |
|
| I32* temp; |
| 1804 |
|
| PPCODE: |
| 1805 |
2 |
| temp = PL_markstack_ptr++; |
| 1806 |
2 |
| assignNV(aTHX_ a, val); |
| 1807 |
2 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
2 |
0 |
2 |
|
| 1808 |
|
| /* truly void, because dXSARGS not invoked */ |
| 1809 |
2 |
| PL_markstack_ptr = temp; |
| 1810 |
2 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 1811 |
|
| } |
| 1812 |
|
| /* must have used dXSARGS; list context implied */ |
| 1813 |
0 |
| return; /* assume stack size is correct */ |
| 1814 |
|
| |
| 1815 |
|
| void |
| 1816 |
|
| assignD64 (a, val) |
| 1817 |
|
| SV * a |
| 1818 |
|
| SV * val |
| 1819 |
|
| PREINIT: |
| 1820 |
|
| I32* temp; |
| 1821 |
|
| PPCODE: |
| 1822 |
1 |
| temp = PL_markstack_ptr++; |
| 1823 |
1 |
| assignD64(aTHX_ a, val); |
| 1824 |
1 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
1 |
0 |
1 |
|
| 1825 |
|
| /* truly void, because dXSARGS not invoked */ |
| 1826 |
1 |
| PL_markstack_ptr = temp; |
| 1827 |
1 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 1828 |
|
| } |
| 1829 |
|
| /* must have used dXSARGS; list context implied */ |
| 1830 |
0 |
| return; /* assume stack size is correct */ |
| 1831 |
|
| |
| 1832 |
|
| void |
| 1833 |
|
| assignNaN (a) |
| 1834 |
|
| SV * a |
| 1835 |
|
| PREINIT: |
| 1836 |
|
| I32* temp; |
| 1837 |
|
| PPCODE: |
| 1838 |
2 |
| temp = PL_markstack_ptr++; |
| 1839 |
2 |
| assignNaN(aTHX_ a); |
| 1840 |
2 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
2 |
0 |
2 |
|
| 1841 |
|
| /* truly void, because dXSARGS not invoked */ |
| 1842 |
2 |
| PL_markstack_ptr = temp; |
| 1843 |
2 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 1844 |
|
| } |
| 1845 |
|
| /* must have used dXSARGS; list context implied */ |
| 1846 |
0 |
| return; /* assume stack size is correct */ |
| 1847 |
|
| |
| 1848 |
|
| void |
| 1849 |
|
| assignInf (a, sign) |
| 1850 |
|
| SV * a |
| 1851 |
|
| int sign |
| 1852 |
|
| PREINIT: |
| 1853 |
|
| I32* temp; |
| 1854 |
|
| PPCODE: |
| 1855 |
4 |
| temp = PL_markstack_ptr++; |
| 1856 |
4 |
| assignInf(aTHX_ a, sign); |
| 1857 |
4 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
4 |
0 |
4 |
|
| 1858 |
|
| /* truly void, because dXSARGS not invoked */ |
| 1859 |
4 |
| PL_markstack_ptr = temp; |
| 1860 |
4 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 1861 |
|
| } |
| 1862 |
|
| /* must have used dXSARGS; list context implied */ |
| 1863 |
0 |
| return; /* assume stack size is correct */ |
| 1864 |
|
| |
| 1865 |
|
| SV * |
| 1866 |
|
| _overload_add (a, b, third) |
| 1867 |
|
| SV * a |
| 1868 |
|
| SV * b |
| 1869 |
|
| SV * third |
| 1870 |
|
| CODE: |
| 1871 |
43 |
| RETVAL = _overload_add (aTHX_ a, b, third); |
| 1872 |
|
| OUTPUT: RETVAL |
| 1873 |
|
| |
| 1874 |
|
| SV * |
| 1875 |
|
| _overload_mul (a, b, third) |
| 1876 |
|
| SV * a |
| 1877 |
|
| SV * b |
| 1878 |
|
| SV * third |
| 1879 |
|
| CODE: |
| 1880 |
852 |
| RETVAL = _overload_mul (aTHX_ a, b, third); |
| 1881 |
|
| OUTPUT: RETVAL |
| 1882 |
|
| |
| 1883 |
|
| SV * |
| 1884 |
|
| _overload_sub (a, b, third) |
| 1885 |
|
| SV * a |
| 1886 |
|
| SV * b |
| 1887 |
|
| SV * third |
| 1888 |
|
| CODE: |
| 1889 |
36 |
| RETVAL = _overload_sub (aTHX_ a, b, third); |
| 1890 |
|
| OUTPUT: RETVAL |
| 1891 |
|
| |
| 1892 |
|
| SV * |
| 1893 |
|
| _overload_neg (a, b, third) |
| 1894 |
|
| SV * a |
| 1895 |
|
| SV * b |
| 1896 |
|
| SV * third |
| 1897 |
|
| CODE: |
| 1898 |
4 |
| RETVAL = _overload_neg (aTHX_ a, b, third); |
| 1899 |
|
| OUTPUT: RETVAL |
| 1900 |
|
| |
| 1901 |
|
| SV * |
| 1902 |
|
| _overload_div (a, b, third) |
| 1903 |
|
| SV * a |
| 1904 |
|
| SV * b |
| 1905 |
|
| SV * third |
| 1906 |
|
| CODE: |
| 1907 |
30 |
| RETVAL = _overload_div (aTHX_ a, b, third); |
| 1908 |
|
| OUTPUT: RETVAL |
| 1909 |
|
| |
| 1910 |
|
| SV * |
| 1911 |
|
| _overload_add_eq (a, b, third) |
| 1912 |
|
| SV * a |
| 1913 |
|
| SV * b |
| 1914 |
|
| SV * third |
| 1915 |
|
| CODE: |
| 1916 |
200102 |
| RETVAL = _overload_add_eq (aTHX_ a, b, third); |
| 1917 |
|
| OUTPUT: RETVAL |
| 1918 |
|
| |
| 1919 |
|
| SV * |
| 1920 |
|
| _overload_mul_eq (a, b, third) |
| 1921 |
|
| SV * a |
| 1922 |
|
| SV * b |
| 1923 |
|
| SV * third |
| 1924 |
|
| CODE: |
| 1925 |
1552 |
| RETVAL = _overload_mul_eq (aTHX_ a, b, third); |
| 1926 |
|
| OUTPUT: RETVAL |
| 1927 |
|
| |
| 1928 |
|
| SV * |
| 1929 |
|
| _overload_sub_eq (a, b, third) |
| 1930 |
|
| SV * a |
| 1931 |
|
| SV * b |
| 1932 |
|
| SV * third |
| 1933 |
|
| CODE: |
| 1934 |
58840 |
| RETVAL = _overload_sub_eq (aTHX_ a, b, third); |
| 1935 |
|
| OUTPUT: RETVAL |
| 1936 |
|
| |
| 1937 |
|
| SV * |
| 1938 |
|
| _overload_div_eq (a, b, third) |
| 1939 |
|
| SV * a |
| 1940 |
|
| SV * b |
| 1941 |
|
| SV * third |
| 1942 |
|
| CODE: |
| 1943 |
22 |
| RETVAL = _overload_div_eq (aTHX_ a, b, third); |
| 1944 |
|
| OUTPUT: RETVAL |
| 1945 |
|
| |
| 1946 |
|
| SV * |
| 1947 |
|
| _overload_equiv (a, b, third) |
| 1948 |
|
| SV * a |
| 1949 |
|
| SV * b |
| 1950 |
|
| SV * third |
| 1951 |
|
| CODE: |
| 1952 |
200134 |
| RETVAL = _overload_equiv (aTHX_ a, b, third); |
| 1953 |
|
| OUTPUT: RETVAL |
| 1954 |
|
| |
| 1955 |
|
| SV * |
| 1956 |
|
| _overload_not_equiv (a, b, third) |
| 1957 |
|
| SV * a |
| 1958 |
|
| SV * b |
| 1959 |
|
| SV * third |
| 1960 |
|
| CODE: |
| 1961 |
211739 |
| RETVAL = _overload_not_equiv (aTHX_ a, b, third); |
| 1962 |
|
| OUTPUT: RETVAL |
| 1963 |
|
| |
| 1964 |
|
| SV * |
| 1965 |
|
| _overload_lt (a, b, third) |
| 1966 |
|
| SV * a |
| 1967 |
|
| SV * b |
| 1968 |
|
| SV * third |
| 1969 |
|
| CODE: |
| 1970 |
23905 |
| RETVAL = _overload_lt (aTHX_ a, b, third); |
| 1971 |
|
| OUTPUT: RETVAL |
| 1972 |
|
| |
| 1973 |
|
| SV * |
| 1974 |
|
| _overload_gt (a, b, third) |
| 1975 |
|
| SV * a |
| 1976 |
|
| SV * b |
| 1977 |
|
| SV * third |
| 1978 |
|
| CODE: |
| 1979 |
24595 |
| RETVAL = _overload_gt (aTHX_ a, b, third); |
| 1980 |
|
| OUTPUT: RETVAL |
| 1981 |
|
| |
| 1982 |
|
| SV * |
| 1983 |
|
| _overload_lte (a, b, third) |
| 1984 |
|
| SV * a |
| 1985 |
|
| SV * b |
| 1986 |
|
| SV * third |
| 1987 |
|
| CODE: |
| 1988 |
25 |
| RETVAL = _overload_lte (aTHX_ a, b, third); |
| 1989 |
|
| OUTPUT: RETVAL |
| 1990 |
|
| |
| 1991 |
|
| SV * |
| 1992 |
|
| _overload_gte (a, b, third) |
| 1993 |
|
| SV * a |
| 1994 |
|
| SV * b |
| 1995 |
|
| SV * third |
| 1996 |
|
| CODE: |
| 1997 |
78052 |
| RETVAL = _overload_gte (aTHX_ a, b, third); |
| 1998 |
|
| OUTPUT: RETVAL |
| 1999 |
|
| |
| 2000 |
|
| SV * |
| 2001 |
|
| _overload_spaceship (a, b, third) |
| 2002 |
|
| SV * a |
| 2003 |
|
| SV * b |
| 2004 |
|
| SV * third |
| 2005 |
|
| CODE: |
| 2006 |
45 |
| RETVAL = _overload_spaceship (aTHX_ a, b, third); |
| 2007 |
|
| OUTPUT: RETVAL |
| 2008 |
|
| |
| 2009 |
|
| SV * |
| 2010 |
|
| _overload_copy (a, b, third) |
| 2011 |
|
| SV * a |
| 2012 |
|
| SV * b |
| 2013 |
|
| SV * third |
| 2014 |
|
| CODE: |
| 2015 |
3060 |
| RETVAL = _overload_copy (aTHX_ a, b, third); |
| 2016 |
|
| OUTPUT: RETVAL |
| 2017 |
|
| |
| 2018 |
|
| SV * |
| 2019 |
|
| D64toD64 (a) |
| 2020 |
|
| SV * a |
| 2021 |
|
| CODE: |
| 2022 |
25 |
| RETVAL = D64toD64 (aTHX_ a); |
| 2023 |
|
| OUTPUT: RETVAL |
| 2024 |
|
| |
| 2025 |
|
| SV * |
| 2026 |
|
| _overload_true (a, b, third) |
| 2027 |
|
| SV * a |
| 2028 |
|
| SV * b |
| 2029 |
|
| SV * third |
| 2030 |
|
| CODE: |
| 2031 |
6 |
| RETVAL = _overload_true (aTHX_ a, b, third); |
| 2032 |
|
| OUTPUT: RETVAL |
| 2033 |
|
| |
| 2034 |
|
| SV * |
| 2035 |
|
| _overload_not (a, b, third) |
| 2036 |
|
| SV * a |
| 2037 |
|
| SV * b |
| 2038 |
|
| SV * third |
| 2039 |
|
| CODE: |
| 2040 |
62 |
| RETVAL = _overload_not (aTHX_ a, b, third); |
| 2041 |
|
| OUTPUT: RETVAL |
| 2042 |
|
| |
| 2043 |
|
| SV * |
| 2044 |
|
| _overload_abs (a, b, third) |
| 2045 |
|
| SV * a |
| 2046 |
|
| SV * b |
| 2047 |
|
| SV * third |
| 2048 |
|
| CODE: |
| 2049 |
2 |
| RETVAL = _overload_abs (aTHX_ a, b, third); |
| 2050 |
|
| OUTPUT: RETVAL |
| 2051 |
|
| |
| 2052 |
|
| SV * |
| 2053 |
|
| _overload_inc (p, second, third) |
| 2054 |
|
| SV * p |
| 2055 |
|
| SV * second |
| 2056 |
|
| SV * third |
| 2057 |
|
| CODE: |
| 2058 |
1 |
| RETVAL = _overload_inc (aTHX_ p, second, third); |
| 2059 |
|
| OUTPUT: RETVAL |
| 2060 |
|
| |
| 2061 |
|
| SV * |
| 2062 |
|
| _overload_dec (p, second, third) |
| 2063 |
|
| SV * p |
| 2064 |
|
| SV * second |
| 2065 |
|
| SV * third |
| 2066 |
|
| CODE: |
| 2067 |
1 |
| RETVAL = _overload_dec (aTHX_ p, second, third); |
| 2068 |
|
| OUTPUT: RETVAL |
| 2069 |
|
| |
| 2070 |
|
| SV * |
| 2071 |
|
| _itsa (a) |
| 2072 |
|
| SV * a |
| 2073 |
|
| CODE: |
| 2074 |
146 |
| RETVAL = _itsa (aTHX_ a); |
| 2075 |
|
| OUTPUT: RETVAL |
| 2076 |
|
| |
| 2077 |
|
| SV * |
| 2078 |
|
| is_NaND64 (b) |
| 2079 |
|
| SV * b |
| 2080 |
|
| CODE: |
| 2081 |
48167 |
| RETVAL = is_NaND64 (aTHX_ b); |
| 2082 |
|
| OUTPUT: RETVAL |
| 2083 |
|
| |
| 2084 |
|
| SV * |
| 2085 |
|
| is_InfD64 (b) |
| 2086 |
|
| SV * b |
| 2087 |
|
| CODE: |
| 2088 |
48244 |
| RETVAL = is_InfD64 (aTHX_ b); |
| 2089 |
|
| OUTPUT: RETVAL |
| 2090 |
|
| |
| 2091 |
|
| SV * |
| 2092 |
|
| is_ZeroD64 (b) |
| 2093 |
|
| SV * b |
| 2094 |
|
| CODE: |
| 2095 |
226372 |
| RETVAL = is_ZeroD64 (aTHX_ b); |
| 2096 |
|
| OUTPUT: RETVAL |
| 2097 |
|
| |
| 2098 |
|
| SV * |
| 2099 |
|
| _wrap_count () |
| 2100 |
|
| CODE: |
| 2101 |
0 |
| RETVAL = _wrap_count (aTHX); |
| 2102 |
|
| OUTPUT: RETVAL |
| 2103 |
|
| |
| 2104 |
|
| |
| 2105 |
|
| SV * |
| 2106 |
|
| _get_xs_version () |
| 2107 |
|
| CODE: |
| 2108 |
1 |
| RETVAL = _get_xs_version (aTHX); |
| 2109 |
|
| OUTPUT: RETVAL |
| 2110 |
|
| |
| 2111 |
|
| |
| 2112 |
|
| void |
| 2113 |
|
| _d64_bytes (sv) |
| 2114 |
|
| SV * sv |
| 2115 |
|
| PREINIT: |
| 2116 |
|
| I32* temp; |
| 2117 |
|
| PPCODE: |
| 2118 |
183975 |
| temp = PL_markstack_ptr++; |
| 2119 |
183975 |
| _d64_bytes(aTHX_ sv); |
| 2120 |
183975 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
0 |
183975 |
183975 |
|
| 2121 |
|
| /* truly void, because dXSARGS not invoked */ |
| 2122 |
0 |
| PL_markstack_ptr = temp; |
| 2123 |
0 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 2124 |
|
| } |
| 2125 |
|
| /* must have used dXSARGS; list context implied */ |
| 2126 |
183975 |
| return; /* assume stack size is correct */ |
| 2127 |
|
| |
| 2128 |
|
| void |
| 2129 |
|
| _bid_mant (bin) |
| 2130 |
|
| SV * bin |
| 2131 |
|
| PREINIT: |
| 2132 |
|
| I32* temp; |
| 2133 |
|
| PPCODE: |
| 2134 |
180777 |
| temp = PL_markstack_ptr++; |
| 2135 |
180777 |
| _bid_mant(aTHX_ bin); |
| 2136 |
180777 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
0 |
180777 |
180777 |
|
| 2137 |
|
| /* truly void, because dXSARGS not invoked */ |
| 2138 |
0 |
| PL_markstack_ptr = temp; |
| 2139 |
0 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 2140 |
|
| } |
| 2141 |
|
| /* must have used dXSARGS; list context implied */ |
| 2142 |
180777 |
| return; /* assume stack size is correct */ |
| 2143 |
|
| |
| 2144 |
|
| SV * |
| 2145 |
|
| _endianness () |
| 2146 |
|
| CODE: |
| 2147 |
1 |
| RETVAL = _endianness (aTHX); |
| 2148 |
|
| OUTPUT: RETVAL |
| 2149 |
|
| |
| 2150 |
|
| |
| 2151 |
|
| SV * |
| 2152 |
|
| _DPDtoD64 (in) |
| 2153 |
|
| char * in |
| 2154 |
|
| CODE: |
| 2155 |
6 |
| RETVAL = _DPDtoD64 (aTHX_ in); |
| 2156 |
|
| OUTPUT: RETVAL |
| 2157 |
|
| |
| 2158 |
|
| void |
| 2159 |
|
| _assignDPD (a, in) |
| 2160 |
|
| SV * a |
| 2161 |
|
| char * in |
| 2162 |
|
| PREINIT: |
| 2163 |
|
| I32* temp; |
| 2164 |
|
| PPCODE: |
| 2165 |
6 |
| temp = PL_markstack_ptr++; |
| 2166 |
6 |
| _assignDPD(aTHX_ a, in); |
| 2167 |
6 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
6 |
0 |
6 |
|
| 2168 |
|
| /* truly void, because dXSARGS not invoked */ |
| 2169 |
6 |
| PL_markstack_ptr = temp; |
| 2170 |
6 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 2171 |
|
| } |
| 2172 |
|
| /* must have used dXSARGS; list context implied */ |
| 2173 |
0 |
| return; /* assume stack size is correct */ |
| 2174 |
|
| |
| 2175 |
|
| int |
| 2176 |
|
| nnumflag () |
| 2177 |
|
| |
| 2178 |
|
| |
| 2179 |
|
| void |
| 2180 |
|
| clear_nnum () |
| 2181 |
|
| |
| 2182 |
|
| PREINIT: |
| 2183 |
|
| I32* temp; |
| 2184 |
|
| PPCODE: |
| 2185 |
1 |
| temp = PL_markstack_ptr++; |
| 2186 |
1 |
| clear_nnum(); |
| 2187 |
1 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
1 |
0 |
1 |
|
| 2188 |
|
| /* truly void, because dXSARGS not invoked */ |
| 2189 |
1 |
| PL_markstack_ptr = temp; |
| 2190 |
1 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 2191 |
|
| } |
| 2192 |
|
| /* must have used dXSARGS; list context implied */ |
| 2193 |
0 |
| return; /* assume stack size is correct */ |
| 2194 |
|
| |
| 2195 |
|
| void |
| 2196 |
|
| set_nnum (x) |
| 2197 |
|
| int x |
| 2198 |
|
| PREINIT: |
| 2199 |
|
| I32* temp; |
| 2200 |
|
| PPCODE: |
| 2201 |
1 |
| temp = PL_markstack_ptr++; |
| 2202 |
1 |
| set_nnum(x); |
| 2203 |
1 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
1 |
0 |
1 |
|
| 2204 |
|
| /* truly void, because dXSARGS not invoked */ |
| 2205 |
1 |
| PL_markstack_ptr = temp; |
| 2206 |
1 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 2207 |
|
| } |
| 2208 |
|
| /* must have used dXSARGS; list context implied */ |
| 2209 |
0 |
| return; /* assume stack size is correct */ |
| 2210 |
|
| |
| 2211 |
|
| int |
| 2212 |
|
| _lln (x) |
| 2213 |
|
| SV * x |
| 2214 |
|
| CODE: |
| 2215 |
0 |
| RETVAL = _lln (aTHX_ x); |
| 2216 |
|
| OUTPUT: RETVAL |
| 2217 |
|
| |