line |
true |
false |
branch |
151
|
41127 |
13 |
if (sv_isobject(n)) { |
152
|
41127 |
0 |
const char *hvname = HvNAME_get(SvSTASH(SvRV(n))); |
|
41127 |
0 |
const char *hvname = HvNAME_get(SvSTASH(SvRV(n))); |
|
0 |
41127 |
const char *hvname = HvNAME_get(SvSTASH(SvRV(n))); |
|
0 |
0 |
const char *hvname = HvNAME_get(SvSTASH(SvRV(n))); |
|
41127 |
0 |
const char *hvname = HvNAME_get(SvSTASH(SvRV(n))); |
|
0 |
41127 |
const char *hvname = HvNAME_get(SvSTASH(SvRV(n))); |
153
|
41127 |
0 |
if (hvname != 0) { |
154
|
3 |
41124 |
if (strEQ(hvname, "Math::BigInt") || strEQ(hvname, "Math::BigFloat") || |
|
0 |
3 |
if (strEQ(hvname, "Math::BigInt") || strEQ(hvname, "Math::BigFloat") || |
|
0 |
0 |
if (strEQ(hvname, "Math::BigInt") || strEQ(hvname, "Math::BigFloat") || |
155
|
0 |
0 |
strEQ(hvname, "Math::GMPz") || strEQ(hvname, "Math::GMP") || |
|
0 |
0 |
strEQ(hvname, "Math::GMPz") || strEQ(hvname, "Math::GMP") || |
156
|
0 |
0 |
strEQ(hvname, "Math::GMPq") || strEQ(hvname, "Math::AnyNum") || |
|
0 |
0 |
strEQ(hvname, "Math::GMPq") || strEQ(hvname, "Math::AnyNum") || |
157
|
0 |
0 |
strEQ(hvname, "Math::Pari") || strEQ(hvname, "Math::BigInt::Lite")) |
177
|
1005314 |
48790 |
if (SVNUMTEST(n)) { /* If defined as number, use it */ |
178
|
1004955 |
359 |
if (SvIsUV(n) || SvIVX(n) >= 0) return 1; /* The normal case */ |
|
978149 |
26806 |
if (SvIsUV(n) || SvIVX(n) >= 0) return 1; /* The normal case */ |
179
|
26795 |
11 |
if (negok) return -1; |
182
|
41127 |
7663 |
if (sv_isobject(n)) { |
184
|
0 |
41127 |
if (!isbignum) return 0; |
187
|
48789 |
1 |
if (SvGAMAGIC(n) && !isbignum) return 0; |
|
41127 |
7662 |
if (SvGAMAGIC(n) && !isbignum) return 0; |
|
41127 |
0 |
if (SvGAMAGIC(n) && !isbignum) return 0; |
|
41127 |
0 |
if (SvGAMAGIC(n) && !isbignum) return 0; |
|
1 |
41127 |
if (SvGAMAGIC(n) && !isbignum) return 0; |
188
|
20 |
48769 |
if (!SvOK(n)) croak("Parameter must be defined"); |
|
20 |
0 |
if (!SvOK(n)) croak("Parameter must be defined"); |
|
20 |
0 |
if (!SvOK(n)) croak("Parameter must be defined"); |
189
|
7414 |
41355 |
ptr = SvPV_nomg(n, len); /* Includes stringifying bigints */ |
190
|
48768 |
1 |
if (len == 0 || ptr == 0) croak("Parameter must be a positive integer"); |
|
0 |
48768 |
if (len == 0 || ptr == 0) croak("Parameter must be a positive integer"); |
191
|
1453 |
47315 |
if (ptr[0] == '-' && negok) { |
|
1449 |
4 |
if (ptr[0] == '-' && negok) { |
193
|
5 |
47314 |
} else if (ptr[0] == '+') { |
196
|
48767 |
1 |
if (len == 0 || !isDIGIT(ptr[0])) |
|
24 |
48743 |
if (len == 0 || !isDIGIT(ptr[0])) |
198
|
48749 |
232 |
while (len > 0 && *ptr == '0') /* Strip all leading zeros */ |
|
238 |
48511 |
while (len > 0 && *ptr == '0') /* Strip all leading zeros */ |
200
|
36834 |
11909 |
if (len > uvmax_maxlen) /* Huge number, don't even look at it */ |
202
|
74142 |
11898 |
for (i = 0; i < len; i++) /* Ensure all characters are digits */ |
203
|
11 |
74131 |
if (!isDIGIT(ptr[i])) |
205
|
1027 |
10871 |
if (isneg == 1) /* Negative number (ignore overflow) */ |
207
|
0 |
10871 |
ret = isneg ? -1 : 1; |
208
|
0 |
10871 |
maxlen = isneg ? ivmax_maxlen : uvmax_maxlen; |
209
|
0 |
10871 |
maxstr = isneg ? ivmax_str : uvmax_str; |
210
|
10540 |
331 |
if (len < maxlen) /* Valid small integer */ |
212
|
1137 |
5 |
for (i = 0; i < maxlen; i++) { /* Check if in range */ |
213
|
84 |
1053 |
if (ptr[i] < maxstr[i]) return ret; |
214
|
242 |
811 |
if (ptr[i] > maxstr[i]) return 0; |
229
|
9692 |
28810 |
int use_gmp = stashflags & VCALL_GMP && _XS_get_callgmp() && _XS_get_callgmp() >= minversion; |
|
0 |
9692 |
int use_gmp = stashflags & VCALL_GMP && _XS_get_callgmp() && _XS_get_callgmp() >= minversion; |
|
0 |
0 |
int use_gmp = stashflags & VCALL_GMP && _XS_get_callgmp() && _XS_get_callgmp() >= minversion; |
231
|
0 |
38502 |
if (use_gmp && hv_exists(MY_CXT.MPUGMP,name,namelen)) { |
|
0 |
0 |
if (use_gmp && hv_exists(MY_CXT.MPUGMP,name,namelen)) { |
233
|
0 |
0 |
if (gvp) gv = *gvp; |
235
|
38502 |
0 |
if (!gv && (stashflags & VCALL_PP)) |
|
30972 |
7530 |
if (!gv && (stashflags & VCALL_PP)) |
237
|
38502 |
0 |
if (!gv) { |
238
|
30972 |
7530 |
GV ** gvp = (GV**)hv_fetch(stashflags & VCALL_PP? MY_CXT.MPUPP : MY_CXT.MPUroot, name,namelen,0); |
239
|
38502 |
0 |
if (gvp) gv = *gvp; |
243
|
0 |
38502 |
PUSHMARK(PL_stack_sp-nargs); |
287
|
0 |
1 |
dSP; ENTER; PUSHMARK(SP); |
288
|
0 |
1 |
XPUSHs(r); |
307
|
0 |
13 |
if (SvTYPE((SV*)av) != SVt_PVAV) |
310
|
0 |
13 |
New(0, r, len, UV); |
311
|
63 |
13 |
for (i = len-1; i >= 0; i--) { |
313
|
0 |
63 |
if (_validate_int(aTHX_ *psvd, 1) != 1) break; |
314
|
0 |
63 |
r[i] = my_svuv(*psvd) + carry; |
315
|
14 |
49 |
if (r[i] >= (UV)base && i > 0) { |
|
11 |
3 |
if (r[i] >= (UV)base && i > 0) { |
322
|
0 |
13 |
if (i >= 0) { |
333
|
122 |
0 |
return (negamod == 0) ? 0 : n-negamod; |
361
|
6969 |
69 |
for (i = 0; i <= CINTS; i++) { |
409
|
6969 |
69 |
for (i = 0; i <= CINTS; i++) { |
425
|
0 |
6 |
if (items == 0) { |
427
|
0 |
6 |
} else if (_XS_get_secure()) { |
430
|
6 |
0 |
data = (unsigned char*) SvPV(seed, size); |
438
|
0 |
5 |
if (_XS_get_secure()) |
440
|
1 |
4 |
if (items == 0) |
453
|
100005 |
8 |
if (ix == 0) |
472
|
2000 |
4033 |
if (m != 0) RETVAL *= m; |
481
|
44 |
1 |
RETVAL = newSV(n == 0 ? 1 : n); |
494
|
2 |
0 |
RETVAL = newSV(n == 0 ? 1 : n); |
560
|
29 |
1147 |
histatus = (items == 1 || _validate_int(aTHX_ ST(1), 0)); |
|
28 |
1 |
histatus = (items == 1 || _validate_int(aTHX_ ST(1), 0)); |
561
|
1175 |
1 |
if (lostatus == 1 && histatus == 1) { |
|
1175 |
0 |
if (lostatus == 1 && histatus == 1) { |
563
|
1147 |
28 |
if (items == 1) { |
565
|
0 |
1147 |
hi = my_svuv(svlo); |
567
|
0 |
28 |
lo = my_svuv(svlo); |
568
|
0 |
28 |
hi = my_svuv(ST(1)); |
570
|
1165 |
10 |
if (lo <= hi) { |
571
|
139 |
1026 |
if (ix == 0) { count = prime_count(lo, hi); } |
572
|
11 |
1015 |
else if (ix == 1) { count = twin_prime_count(lo, hi); } |
573
|
10 |
1005 |
else if (ix == 2) { count = ramanujan_prime_count(lo, hi); } |
574
|
2 |
1003 |
else if (ix == 3) { count = ramanujan_prime_count_approx(hi); |
575
|
0 |
2 |
if (lo > 2) |
577
|
1003 |
0 |
else if (ix == 4) { |
579
|
0 |
1003 |
if (hi >= 29505444491UL && hi-lo > hi/50) { |
|
0 |
0 |
if (hi >= 29505444491UL && hi-lo > hi/50) { |
582
|
0 |
0 |
if (lostatus == 1 && lo > 2) { |
|
0 |
0 |
if (lostatus == 1 && lo > 2) { |
585
|
0 |
0 |
if (count < lo_loc) hicount--; |
588
|
0 |
0 |
if (lostatus == 1 && hicount > 0) |
|
0 |
0 |
if (lostatus == 1 && hicount > 0) |
589
|
0 |
0 |
RETURN_128(hicount, count); |
593
|
0 |
0 |
} else if (ix == 5) { |
594
|
0 |
0 |
int fd = (items < 3) ? fileno(stdout) : my_sviv(ST(2)); |
|
0 |
0 |
int fd = (items < 3) ? fileno(stdout) : my_sviv(ST(2)); |
599
|
1175 |
0 |
if (lostatus == 1) XSRETURN_UV(count); |
602
|
1 |
0 |
case 0: _vcallsubn(aTHX_ GIMME_V, VCALL_ROOT, "_generic_prime_count", items, 0); break; |
619
|
10024 |
12000 |
histatus = (items == 1 || _validate_int(aTHX_ svhi, 0)); |
|
10017 |
1 |
histatus = (items == 1 || _validate_int(aTHX_ svhi, 0)); |
620
|
22017 |
1 |
if (lostatus == 1 && histatus == 1) { |
|
22017 |
0 |
if (lostatus == 1 && histatus == 1) { |
621
|
12000 |
10017 |
if (items == 1) { |
623
|
0 |
12000 |
hi = my_svuv(svlo); |
625
|
0 |
10017 |
lo = my_svuv(svlo); |
626
|
0 |
10017 |
hi = my_svuv(svhi); |
629
|
22011 |
6 |
if (ret) XSRETURN_UV(ret); |
633
|
0 |
1 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
678
|
1078 |
131 |
if ((low <= 2) && (high >= 2) && ix != 4) { av_push(av, newSVuv( 2 )); } |
|
1074 |
4 |
if ((low <= 2) && (high >= 2) && ix != 4) { av_push(av, newSVuv( 2 )); } |
|
1069 |
5 |
if ((low <= 2) && (high >= 2) && ix != 4) { av_push(av, newSVuv( 2 )); } |
679
|
1090 |
119 |
if ((low <= 3) && (high >= 3) && ix != 5) { av_push(av, newSVuv( 3 )); } |
|
1076 |
14 |
if ((low <= 3) && (high >= 3) && ix != 5) { av_push(av, newSVuv( 3 )); } |
|
1071 |
5 |
if ((low <= 3) && (high >= 3) && ix != 5) { av_push(av, newSVuv( 3 )); } |
680
|
1099 |
110 |
if ((low <= 5) && (high >= 5) && ix != 5) { av_push(av, newSVuv( 5 )); } |
|
1070 |
29 |
if ((low <= 5) && (high >= 5) && ix != 5) { av_push(av, newSVuv( 5 )); } |
|
1065 |
5 |
if ((low <= 5) && (high >= 5) && ix != 5) { av_push(av, newSVuv( 5 )); } |
681
|
1101 |
108 |
if (low < 7) low = 7; |
682
|
1166 |
43 |
if (low <= high) { |
683
|
17 |
1149 |
if (ix == 4) high += 2; |
684
|
1098 |
68 |
if (ix == 0) { /* Sieve with primary cache */ |
685
|
0 |
1098 |
START_DO_FOR_EACH_PRIME(low, high) { |
|
0 |
1193446 |
START_DO_FOR_EACH_PRIME(low, high) { |
|
0 |
0 |
START_DO_FOR_EACH_PRIME(low, high) { |
|
0 |
0 |
START_DO_FOR_EACH_PRIME(low, high) { |
|
447230 |
746216 |
START_DO_FOR_EACH_PRIME(low, high) { |
|
158 |
466900 |
START_DO_FOR_EACH_PRIME(low, high) { |
|
19828 |
447072 |
START_DO_FOR_EACH_PRIME(low, high) { |
|
158 |
447072 |
START_DO_FOR_EACH_PRIME(low, high) { |
|
0 |
1193288 |
START_DO_FOR_EACH_PRIME(low, high) { |
|
940 |
1192348 |
START_DO_FOR_EACH_PRIME(low, high) { |
688
|
11 |
57 |
} else if (ix == 1) { /* Trial */ |
689
|
547 |
11 |
for (low = next_prime(low-1); |
690
|
547 |
0 |
low <= high && low != 0; |
694
|
9 |
48 |
} else if (ix == 2) { /* Erat with private memory */ |
696
|
639 |
0 |
START_DO_FOR_EACH_SIEVE_PRIME( sieve, 0, low, high ) { |
|
9 |
630 |
START_DO_FOR_EACH_SIEVE_PRIME( sieve, 0, low, high ) { |
|
538 |
92 |
START_DO_FOR_EACH_SIEVE_PRIME( sieve, 0, low, high ) { |
|
639 |
17 |
START_DO_FOR_EACH_SIEVE_PRIME( sieve, 0, low, high ) { |
|
26 |
9 |
START_DO_FOR_EACH_SIEVE_PRIME( sieve, 0, low, high ) { |
700
|
32 |
16 |
} else if (ix == 3 || ix == 4) { /* Segment */ |
|
17 |
15 |
} else if (ix == 3 || ix == 4) { /* Segment */ |
704
|
37 |
33 |
while (next_segment_primes(ctx, &seg_base, &seg_low, &seg_high)) { |
705
|
394266 |
0 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
33 |
394233 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
394200 |
33 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
394266 |
22927 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
22960 |
37 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
706
|
308148 |
86052 |
if (ix == 3) av_push(av,newSVuv( p )); |
707
|
8957 |
77095 |
else if (lastp+2 == p) av_push(av,newSVuv( lastp )); |
712
|
15 |
0 |
} else if (ix == 5) { /* Ramanujan primes */ |
715
|
15 |
0 |
if (L && end >= beg) |
|
14 |
1 |
if (L && end >= beg) |
716
|
94 |
14 |
for (i = beg; i <= end; i++) |
719
|
0 |
0 |
} else if (ix == 6) { /* Ramanujan primes */ |
722
|
0 |
0 |
if (L && high >= low) |
|
0 |
0 |
if (L && high >= low) |
723
|
0 |
0 |
for (i = low; i <= high; i++) |
736
|
10 |
0 |
if (status == 1) { |
738
|
0 |
10 |
UV factors[MPU_MAX_FACTORS+1], i, n = my_svuv(svn); |
739
|
0 |
10 |
if (depth == 0) depth = 1; /* Trial factor takes 0 to means sqrt(n) */ |
740
|
0 |
10 |
if ( (n + width) < n) { /* Overflow */ |
742
|
10 |
0 |
} else if (depth <= 100) { /* trial division for each value */ |
743
|
4 |
6 |
for (i = (n<2)?2-n:0; i < width; i++) |
|
1610 |
10 |
for (i = (n<2)?2-n:0; i < width; i++) |
744
|
316 |
1294 |
if (trial_factor(n+i, factors, 2, depth) < 2) |
745
|
0 |
316 |
XPUSHs(sv_2mortal(newSVuv( i ))); |
747
|
0 |
0 |
for (i = (n<2)?2-n:0; i < width; i++) |
|
0 |
0 |
for (i = (n<2)?2-n:0; i < width; i++) |
748
|
0 |
0 |
if (trial_factor(n+i, factors, 2, 100) < 2) |
749
|
0 |
0 |
if (factor(n+i,factors) < 2 || factors[0] > depth) |
|
0 |
0 |
if (factor(n+i,factors) < 2 || factors[0] > depth) |
750
|
0 |
0 |
XPUSHs(sv_2mortal(newSVuv( i ))); |
753
|
0 |
10 |
if (status != 1) { |
754
|
0 |
0 |
_vcallsubn(aTHX_ GIMME_V, VCALL_GMP|VCALL_PP, "sieve_range", items, 36); |
766
|
0 |
41 |
if (items > 100) croak("sieve_prime_cluster: too many entries"); |
768
|
215 |
41 |
for (i = 1; i < nc; i++) { |
769
|
0 |
215 |
if (!_validate_int(aTHX_ ST(1+i), 0)) croak("sieve_prime_cluster: cluster values must be standard integers"); |
770
|
0 |
215 |
cval = my_svuv(ST(1+i)); |
771
|
0 |
215 |
if (cval & 1) croak("sieve_prime_cluster: values must be even"); |
772
|
0 |
215 |
if (cval > 2147483647UL) croak("sieve_prime_cluster: values must be 31-bit"); |
773
|
0 |
215 |
if (cval <= cl[i-1]) croak("sieve_prime_cluster: values must be increasing"); |
779
|
32 |
9 |
if (lostatus == 1 && histatus == 1) { |
|
32 |
0 |
if (lostatus == 1 && histatus == 1) { |
780
|
0 |
32 |
UV low = my_svuv(svlo); |
781
|
0 |
32 |
UV high = my_svuv(svhi); |
783
|
32 |
0 |
if (list != 0) { |
785
|
32 |
0 |
EXTEND(SP, (IV)nprimes); |
|
1 |
31 |
EXTEND(SP, (IV)nprimes); |
786
|
12276 |
32 |
for (i = 0; i < nprimes; i++) |
791
|
9 |
32 |
if (!done) { |
792
|
9 |
0 |
_vcallsubn(aTHX_ GIMME_V, VCALL_GMP|VCALL_PP, "sieve_prime_cluster", items, 34); |
814
|
0 |
83 |
if (n == 0) XSRETURN_UV(0); |
815
|
0 |
83 |
if (ix == 9) { /* We don't have an ecm_factor, call PP. */ |
816
|
0 |
0 |
_vcallsubn(aTHX_ GIMME_V, VCALL_PP, "ecm_factor", 1, 0); |
820
|
2 |
81 |
arg1 = (items >= 2) ? my_svuv(ST(1)) : default_arg1[ix]; |
|
0 |
2 |
arg1 = (items >= 2) ? my_svuv(ST(1)) : default_arg1[ix]; |
821
|
0 |
83 |
arg2 = (items >= 3) ? my_svuv(ST(2)) : 0; |
|
0 |
0 |
arg2 = (items >= 3) ? my_svuv(ST(2)) : 0; |
823
|
0 |
48 |
while ( (n% 2) == 0 ) { n /= 2; XPUSHs(sv_2mortal(newSVuv( 2 ))); } |
|
48 |
83 |
while ( (n% 2) == 0 ) { n /= 2; XPUSHs(sv_2mortal(newSVuv( 2 ))); } |
824
|
0 |
48 |
while ( (n% 3) == 0 ) { n /= 3; XPUSHs(sv_2mortal(newSVuv( 3 ))); } |
|
48 |
83 |
while ( (n% 3) == 0 ) { n /= 3; XPUSHs(sv_2mortal(newSVuv( 3 ))); } |
825
|
0 |
64 |
while ( (n% 5) == 0 ) { n /= 5; XPUSHs(sv_2mortal(newSVuv( 5 ))); } |
|
64 |
83 |
while ( (n% 5) == 0 ) { n /= 5; XPUSHs(sv_2mortal(newSVuv( 5 ))); } |
826
|
43 |
40 |
if (n == 1) { /* done */ } |
827
|
24 |
19 |
else if (is_prime(n)) { XPUSHs(sv_2mortal(newSVuv( n ))); } |
|
0 |
24 |
else if (is_prime(n)) { XPUSHs(sv_2mortal(newSVuv( n ))); } |
839
|
2 |
0 |
case 7: if (items < 3) arg2 = 1; |
842
|
2 |
0 |
default: if (items < 3) arg2 = 10*arg1; |
845
|
19 |
0 |
EXTEND(SP, nfactors); |
|
0 |
19 |
EXTEND(SP, nfactors); |
846
|
39 |
19 |
for (i = 0; i < nfactors; i++) |
858
|
1 |
55097 |
if (items < 2) |
861
|
160239 |
54837 |
for (c = 0; c < items && status == 1; c++) |
|
159979 |
260 |
for (c = 0; c < items && status == 1; c++) |
862
|
260 |
159719 |
if (_validate_int(aTHX_ ST(c), 0) != 1) |
864
|
54837 |
260 |
if (status == 1) { |
865
|
0 |
54837 |
UV n = my_svuv(svn); |
867
|
7 |
54830 |
if (n < 4) { /* 0,1 composite; 2,3 prime */ |
869
|
82 |
54748 |
} else if (ix == 1) { /* Fermat test */ |
870
|
86 |
82 |
for (c = 1; c < items && ret == 1; c++) |
|
86 |
0 |
for (c = 1; c < items && ret == 1; c++) |
871
|
0 |
86 |
ret = is_pseudoprime(n, my_svuv(ST(c))); |
872
|
109 |
54639 |
} else if (ix == 2) { /* Euler test */ |
873
|
109 |
109 |
for (c = 1; c < items && ret == 1; c++) |
|
109 |
0 |
for (c = 1; c < items && ret == 1; c++) |
874
|
0 |
109 |
ret = is_euler_pseudoprime(n, my_svuv(ST(c))); |
875
|
27067 |
27572 |
} else if ((n % 2) == 0) { /* evens composite */ |
879
|
27572 |
27570 |
for (c = 1; c < items && ret == 1; ) { |
|
27572 |
0 |
for (c = 1; c < items && ret == 1; ) { |
880
|
80133 |
0 |
for (b = 0; b < 32 && c < items; c++) |
|
52561 |
27572 |
for (b = 0; b < 32 && c < items; c++) |
881
|
0 |
52561 |
bases[b++] = my_svuv(ST(c)); |
885
|
54835 |
0 |
RETURN_NPARITY(ret); |
|
54835 |
0 |
RETURN_NPARITY(ret); |
908
|
20368 |
14 |
if (ix == 2 || ix == 3) { |
|
15 |
20353 |
if (ix == 2 || ix == 3) { |
911
|
2 |
27 |
if (items == 0) XSRETURN_UNDEF; |
912
|
6 |
21 |
if (items == 1) XSRETURN(1); |
914
|
19 |
2 |
if (status != 0 && items > 1) { |
|
19 |
0 |
if (status != 0 && items > 1) { |
916
|
0 |
19 |
ret = my_svuv(ST(0)); |
917
|
79 |
19 |
for (i = 1; i < items; i++) { |
919
|
0 |
79 |
if (status == 0) break; |
920
|
0 |
79 |
n = my_svuv(ST(i)); |
921
|
21 |
58 |
if (( (sign == -1 && status == 1) || |
|
15 |
6 |
if (( (sign == -1 && status == 1) || |
|
50 |
23 |
if (( (sign == -1 && status == 1) || |
|
31 |
48 |
if (( (sign == -1 && status == 1) || |
922
|
40 |
10 |
(n >= ret && sign == status) |
930
|
19 |
2 |
if (status != 0) { |
934
|
2567 |
17786 |
} else if (ix == 4) { |
937
|
118052 |
2044 |
for (ret = i = 0; i < items; i++) { |
939
|
403 |
117649 |
if (status == 0) break; |
940
|
20 |
117629 |
n = my_svuv(ST(i)); |
941
|
116696 |
953 |
if (status == 1) { |
944
|
120 |
833 |
if (UV_MAX-n == (UV)IV_MAX) { status = 0; break; } /* IV Overflow */ |
949
|
2044 |
523 |
if (status != 0 && hi != 0) { |
|
5 |
2039 |
if (status != 0 && hi != 0) { |
950
|
4 |
1 |
if (hi == -1 && lo > IV_MAX) XSRETURN_IV((IV)lo); |
|
4 |
0 |
if (hi == -1 && lo > IV_MAX) XSRETURN_IV((IV)lo); |
951
|
0 |
1 |
else RETURN_128(hi, lo); |
954
|
15816 |
1970 |
} else if (ix == 5) { |
957
|
19664 |
1788 |
for (i = 0; i < items; i++) { |
959
|
13363 |
6301 |
if (status == 0) break; |
960
|
6292 |
9 |
n = (status == 1) ? my_svuv(ST(i)) : (UV)-my_sviv(ST(i)); |
|
0 |
6292 |
n = (status == 1) ? my_svuv(ST(i)) : (UV)-my_sviv(ST(i)); |
|
9 |
0 |
n = (status == 1) ? my_svuv(ST(i)) : (UV)-my_sviv(ST(i)); |
961
|
6300 |
1 |
if (ret > 0 && n > UV_MAX/ret) { status = 0; break; } |
|
665 |
5635 |
if (ret > 0 && n > UV_MAX/ret) { status = 0; break; } |
965
|
5 |
15811 |
if (sign == -1 && status != 0) { |
|
5 |
0 |
if (sign == -1 && status != 0) { |
966
|
5 |
0 |
if (ret <= (UV)IV_MAX) XSRETURN_IV(-(IV)ret); |
971
|
1946 |
24 |
if (ix == 0) { ret = 0; nullv = 1; } |
973
|
3954 |
1958 |
for (i = 0; i < items && ret != nullv && status != 0; i++) { |
|
3950 |
4 |
for (i = 0; i < items && ret != nullv && status != 0; i++) { |
|
3949 |
1 |
for (i = 0; i < items && ret != nullv && status != 0; i++) { |
975
|
7 |
3942 |
if (status == 0) |
977
|
6 |
3936 |
n = status * my_svuv(ST(i)); /* n = abs(arg) */ |
978
|
1964 |
1978 |
if (i == 0) { |
982
|
1950 |
28 |
if (ix == 0) { |
986
|
26 |
2 |
if (n <= (UV_MAX / ret) ) ret *= n; |
992
|
5783 |
14562 |
if (status != 0) |
995
|
14561 |
1 |
if ((ix == 2 || ix == 3) && !sv_isobject(ST(0))) { |
|
1 |
14560 |
if ((ix == 2 || ix == 3) && !sv_isobject(ST(0))) { |
|
2 |
0 |
if ((ix == 2 || ix == 3) && !sv_isobject(ST(0))) { |
1000
|
2 |
0 |
aptr = SvPV(ST(0), alen); |
1002
|
2 |
2 |
for (i = 1; i < items; i++) { |
1003
|
2 |
0 |
bptr = SvPV(ST(i), blen); |
1004
|
2 |
0 |
if (strnum_minmax(minmax, aptr, alen, bptr, blen)) { |
1030
|
2 |
0 |
if ((!SvROK(x)) || (SvTYPE(SvRV(x)) != SVt_PVAV)) |
|
0 |
2 |
if ((!SvROK(x)) || (SvTYPE(SvRV(x)) != SVt_PVAV)) |
1033
|
1 |
1 |
if (SvROK(svm) && SvTYPE(SvRV(svm)) == SVt_PVAV) { |
|
1 |
0 |
if (SvROK(svm) && SvTYPE(SvRV(svm)) == SVt_PVAV) { |
1036
|
5 |
1 |
for (j = 0; j <= mlen; j++) { |
1038
|
5 |
0 |
if (iv && SvTYPE(*iv) == SVt_IV) { |
|
5 |
0 |
if (iv && SvTYPE(*iv) == SVt_IV) { |
1039
|
5 |
0 |
SV **v = av_fetch(av, SvIV(*iv), 0); |
1040
|
5 |
0 |
if (v) XPUSHs(*v); |
|
0 |
5 |
if (v) XPUSHs(*v); |
1043
|
1 |
0 |
} else if (_validate_int(aTHX_ svm, 0)) { |
1044
|
0 |
1 |
UV mask = my_svuv(svm); |
1045
|
24 |
1 |
while (mask) { |
1046
|
13 |
11 |
if (mask & 1) { |
1048
|
13 |
0 |
if (v) XPUSHs(*v); |
|
0 |
13 |
if (v) XPUSHs(*v); |
1054
|
0 |
0 |
_vcallsubn(aTHX_ GIMME_V, VCALL_PP, "vecextract", items, 0); |
1067
|
0 |
25 |
New(0, an, 2*items, UV); |
1069
|
47 |
22 |
for (i = 0; i < items; i++) { |
1071
|
47 |
0 |
if (!SvROK(ST(i)) || SvTYPE(SvRV(ST(i))) != SVt_PVAV || av_len((AV*)SvRV(ST(i))) != 1) |
|
47 |
0 |
if (!SvROK(ST(i)) || SvTYPE(SvRV(ST(i))) != SVt_PVAV || av_len((AV*)SvRV(ST(i))) != 1) |
|
0 |
47 |
if (!SvROK(ST(i)) || SvTYPE(SvRV(ST(i))) != SVt_PVAV || av_len((AV*)SvRV(ST(i))) != 1) |
1076
|
47 |
0 |
if (psva == 0 || psvn == 0 || _validate_int(aTHX_ *psva, 1) != 1 || !_validate_int(aTHX_ *psvn, 0)) { |
|
47 |
0 |
if (psva == 0 || psvn == 0 || _validate_int(aTHX_ *psva, 1) != 1 || !_validate_int(aTHX_ *psvn, 0)) { |
|
44 |
3 |
if (psva == 0 || psvn == 0 || _validate_int(aTHX_ *psva, 1) != 1 || !_validate_int(aTHX_ *psvn, 0)) { |
|
0 |
44 |
if (psva == 0 || psvn == 0 || _validate_int(aTHX_ *psva, 1) != 1 || !_validate_int(aTHX_ *psvn, 0)) { |
1080
|
0 |
44 |
an[i+0] = my_svuv(*psva); |
1081
|
0 |
44 |
an[i+items] = my_svuv(*psvn); |
1083
|
22 |
3 |
if (status) |
1086
|
5 |
20 |
if (status == -1) XSRETURN_UNDEF; |
1087
|
13 |
7 |
if (status) XSRETURN_UV(ret); |
1090
|
2 |
5 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
2 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
2 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
2 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
1 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
0 |
1 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
0 |
1 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
1 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT( (psvn ? *psvn : 0), ST(0)); |
1101
|
26445 |
199 |
if (ix == 1 || ix == 2) { |
|
152 |
26293 |
if (ix == 1 || ix == 2) { |
1102
|
0 |
351 |
if (items != 3) croak("lucasu: P, Q, k"); |
1103
|
351 |
0 |
if (_validate_int(aTHX_ ST(0), 1) && _validate_int(aTHX_ ST(1), 1) && |
1105
|
351 |
0 |
IV P = my_sviv(ST(0)); |
1106
|
351 |
0 |
IV Q = my_sviv(ST(1)); |
1107
|
0 |
351 |
UV k = my_svuv(ST(2)); |
1109
|
199 |
152 |
int ok = (ix == 1) ? lucasu(&ret, P, Q, k) : lucasv(&ret, P, Q, k); |
1110
|
351 |
0 |
if (ok) XSRETURN_IV(ret); |
1112
|
0 |
0 |
_vcallsub_with_gmpobj(0.29,(ix==1) ? "lucasu" : "lucasv"); |
1113
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(2), ST(0)); |
1116
|
0 |
26293 |
if (items != 4) croak("lucas_sequence: n, P, Q, k"); |
1117
|
26291 |
2 |
if (_validate_int(aTHX_ ST(0), 0) && _validate_int(aTHX_ ST(1), 1) && |
1118
|
26291 |
0 |
_validate_int(aTHX_ ST(2), 1) && _validate_int(aTHX_ ST(3), 0)) { |
1119
|
0 |
26291 |
lucas_seq(&U, &V, &Qk, |
|
26278 |
13 |
lucas_seq(&U, &V, &Qk, |
|
26278 |
13 |
lucas_seq(&U, &V, &Qk, |
|
0 |
26291 |
lucas_seq(&U, &V, &Qk, |
1125
|
2 |
0 |
_vcallsubn(aTHX_ GIMME_V, VCALL_PP, "lucas_sequence", items, 0); |
1155
|
454811 |
328 |
if (status == 1) { |
1156
|
12 |
454799 |
UV n = my_svuv(svn); |
1176
|
0 |
2282 |
case 18: ret = is_mersenne_prime(n); if (ret == -1) status = 0; break; |
1180
|
36 |
292 |
} else if (status == -1) { |
1182
|
26 |
10 |
if (ix == 13) { |
1183
|
26 |
0 |
IV sn = my_sviv(svn); |
1184
|
26 |
0 |
if (sn > -IV_MAX) ret = is_square_free(-sn); |
1188
|
454847 |
292 |
if (status != 0) RETURN_NPARITY(ret); |
|
454847 |
0 |
if (status != 0) RETURN_NPARITY(ret); |
|
454847 |
0 |
if (status != 0) RETURN_NPARITY(ret); |
1219
|
52 |
52 |
if (status == 1) |
1220
|
0 |
52 |
RETURN_NPARITY(is_fundamental(my_svuv(svn), 0)); |
|
52 |
0 |
RETURN_NPARITY(is_fundamental(my_svuv(svn), 0)); |
|
52 |
0 |
RETURN_NPARITY(is_fundamental(my_svuv(svn), 0)); |
1221
|
50 |
2 |
if (status == -1) { |
1222
|
50 |
0 |
IV sn = my_sviv(svn); |
1223
|
50 |
0 |
if (sn > -IV_MAX) |
1224
|
50 |
0 |
RETURN_NPARITY(is_fundamental(-sn, 1)); |
|
50 |
0 |
RETURN_NPARITY(is_fundamental(-sn, 1)); |
1236
|
10404 |
256 |
if (status != 0) { |
1238
|
2 |
10402 |
UV n = my_svuv(svn); |
1239
|
65 |
10339 |
if (status == -1) { |
1240
|
17 |
48 |
IV sn = my_sviv(svn); |
1241
|
2 |
63 |
if (sn <= -IV_MAX) status = 0; |
1244
|
65 |
10339 |
if (status == 1 || (status == -1 && (k == 0 || k & 1))) { |
|
63 |
2 |
if (status == 1 || (status == -1 && (k == 0 || k & 1))) { |
|
4 |
59 |
if (status == 1 || (status == -1 && (k == 0 || k & 1))) { |
|
2 |
2 |
if (status == 1 || (status == -1 && (k == 0 || k & 1))) { |
1246
|
61 |
10339 |
if (status == -1 && k == 0) { |
|
59 |
2 |
if (status == -1 && k == 0) { |
1248
|
11 |
48 |
if (ret == 1) ret = 0; |
1250
|
139 |
10261 |
if (ret && svroot != 0) { |
|
29 |
110 |
if (ret && svroot != 0) { |
1251
|
27 |
2 |
UV root = rootof(n, k ? k : (UV)ret); |
1252
|
0 |
29 |
if (!SvROK(svroot)) croak("is_power: third argument not a scalar reference"); |
1253
|
11 |
18 |
if (status == 1) sv_setuv(SvRV(svroot), root); |
1257
|
10402 |
2 |
if (status != 0) RETURN_NPARITY(ret); |
|
10402 |
0 |
if (status != 0) RETURN_NPARITY(ret); |
|
10402 |
0 |
if (status != 0) RETURN_NPARITY(ret); |
1259
|
130 |
128 |
if (svroot == 0) { _vcallsub_with_gmp(0.28, "is_power"); } |
1270
|
0 |
10254 |
if (status == -1) |
1271
|
0 |
0 |
RETURN_NPARITY(0); |
|
0 |
0 |
RETURN_NPARITY(0); |
1272
|
10254 |
0 |
if (status != 0) { |
1273
|
0 |
10254 |
n = my_svuv(svn); |
1275
|
2818 |
7436 |
if (ret && svroot != 0) { |
|
17 |
2801 |
if (ret && svroot != 0) { |
1276
|
0 |
17 |
if (!SvROK(svroot))croak("is_prime_power: second argument not a scalar reference"); |
1279
|
10254 |
0 |
RETURN_NPARITY(ret); |
|
10254 |
0 |
RETURN_NPARITY(ret); |
1281
|
0 |
0 |
(void)_vcallsubn(aTHX_ G_SCALAR, (svroot == 0) ? (VCALL_GMP|VCALL_PP) : (VCALL_PP), "is_prime_power", items, 40); |
1293
|
70 |
1 |
if (status == 1) { |
1294
|
0 |
70 |
UV n = my_svuv(svn); |
1295
|
20 |
50 |
if (ix == 0) ret = is_perrin_pseudoprime(n, k); |
1298
|
70 |
1 |
if (status != 0) RETURN_NPARITY(ret); |
|
70 |
0 |
if (status != 0) RETURN_NPARITY(ret); |
|
70 |
0 |
if (status != 0) RETURN_NPARITY(ret); |
1299
|
1 |
0 |
if (ix == 0) |
1300
|
1 |
0 |
_vcallsub_with_gmp( (k == 0) ? 0.20 : 0.40, "is_perrin_pseudoprime"); |
1312
|
28 |
0 |
if (status == 1) { |
1313
|
0 |
28 |
UV n = my_svuv(svn); |
1316
|
28 |
0 |
if (status != 0) RETURN_NPARITY(ret); |
|
28 |
0 |
if (status != 0) RETURN_NPARITY(ret); |
|
28 |
0 |
if (status != 0) RETURN_NPARITY(ret); |
1326
|
0 |
25302 |
if (k < 3) croak("is_polygonal: k must be >= 3"); |
1328
|
25300 |
2 |
if (status != 0) { |
1330
|
0 |
25300 |
if (status == -1) { |
1333
|
0 |
25300 |
n = my_svuv(svn); |
1335
|
25300 |
0 |
result = (n == 0) || root; |
|
460 |
24840 |
result = (n == 0) || root; |
1337
|
25300 |
0 |
if (!overflow) { |
1338
|
460 |
24840 |
if (result && svroot != 0) { |
|
230 |
230 |
if (result && svroot != 0) { |
1339
|
0 |
230 |
if (!SvROK(svroot)) croak("is_polygonal: third argument not a scalar reference"); |
1342
|
25300 |
0 |
RETURN_NPARITY(result); |
|
25300 |
0 |
RETURN_NPARITY(result); |
1345
|
2 |
0 |
if (items != 3) { _vcallsub_with_gmp(0.47, "is_polygonal"); } |
1358
|
624 |
2 |
if (status != 0) { |
1359
|
0 |
624 |
n = my_svuv(svn); |
1360
|
21 |
603 |
if (svret != 0 && !SvROK(svret)) |
|
0 |
21 |
if (svret != 0 && !SvROK(svret)) |
1361
|
0 |
0 |
croak("%s: third argument not a scalar reference",(ix==0)?"logint":"rootint"); |
1362
|
601 |
23 |
if (ix == 0) { |
1363
|
601 |
0 |
if (status != 1 || n <= 0) croak("logint: n must be > 0"); |
|
0 |
601 |
if (status != 1 || n <= 0) croak("logint: n must be > 0"); |
1364
|
0 |
601 |
if (k <= 1) croak("logint: base must be > 1"); |
1366
|
1 |
600 |
if (svret) sv_setuv(SvRV(svret), ipow(k,root)); |
1368
|
0 |
23 |
if (status == -1) croak("rootint: n must be >= 0"); |
1369
|
0 |
23 |
if (k <= 0) croak("rootint: k must be > 0"); |
1371
|
20 |
3 |
if (svret) sv_setuv(SvRV(svret), ipow(root,k)); |
1376
|
0 |
0 |
case 0: (void)_vcallsubn(aTHX_ G_SCALAR, (svret == 0) ? (VCALL_GMP|VCALL_PP) : (VCALL_PP), "logint", items, 47); break; |
1377
|
2 |
0 |
case 1: (void)_vcallsubn(aTHX_ G_SCALAR, (svret == 0) ? (VCALL_GMP|VCALL_PP) : (VCALL_PP), "rootint", items, 40); break; |
1389
|
1 |
7 |
if (bases < 0) croak("miller_rabin_random: number of bases must be positive"); |
1390
|
5 |
2 |
if (status != 0 && seed == 0) { |
|
5 |
0 |
if (status != 0 && seed == 0) { |
1391
|
0 |
5 |
UV n = my_svuv(svn); |
1392
|
5 |
0 |
RETURN_NPARITY( is_mr_random(MY_CXT.randcxt, n, bases) ); |
|
5 |
0 |
RETURN_NPARITY( is_mr_random(MY_CXT.randcxt, n, bases) ); |
1420
|
9947 |
40 |
if (_validate_int(aTHX_ svn, 0)) { |
1421
|
11 |
9936 |
UV n = my_svuv(svn); |
1422
|
9 |
9938 |
if ( (n >= MPU_MAX_PRIME && ix == 0) || |
|
4 |
5 |
if ( (n >= MPU_MAX_PRIME && ix == 0) || |
|
36 |
9907 |
if ( (n >= MPU_MAX_PRIME && ix == 0) || |
1423
|
36 |
0 |
(n >= MPU_MAX_PRIME_IDX && (ix==2 || ix==3 || ix==4 || ix==5 || ix == 6)) || |
|
35 |
1 |
(n >= MPU_MAX_PRIME_IDX && (ix==2 || ix==3 || ix==4 || ix==5 || ix == 6)) || |
|
32 |
3 |
(n >= MPU_MAX_PRIME_IDX && (ix==2 || ix==3 || ix==4 || ix==5 || ix == 6)) || |
|
32 |
0 |
(n >= MPU_MAX_PRIME_IDX && (ix==2 || ix==3 || ix==4 || ix==5 || ix == 6)) || |
|
0 |
32 |
(n >= MPU_MAX_PRIME_IDX && (ix==2 || ix==3 || ix==4 || ix==5 || ix == 6)) || |
|
41 |
9898 |
(n >= MPU_MAX_PRIME_IDX && (ix==2 || ix==3 || ix==4 || ix==5 || ix == 6)) || |
1424
|
41 |
0 |
(n >= MPU_MAX_TWIN_PRIME_IDX && (ix==7 || ix==8)) || |
|
0 |
41 |
(n >= MPU_MAX_TWIN_PRIME_IDX && (ix==7 || ix==8)) || |
|
41 |
9898 |
(n >= MPU_MAX_TWIN_PRIME_IDX && (ix==7 || ix==8)) || |
1425
|
0 |
41 |
(n >= MPU_MAX_RMJN_PRIME_IDX && (ix==9)) ) { |
1430
|
3759 |
6180 |
if (ix == 1 && n < 3) XSRETURN_UNDEF; |
|
5 |
3754 |
if (ix == 1 && n < 3) XSRETURN_UNDEF; |
1432
|
6 |
9928 |
if (n == 0 && (ix >= 2 && ix <= 9 && ix != 6)) XSRETURN_UNDEF; |
|
5 |
1 |
if (n == 0 && (ix >= 2 && ix <= 9 && ix != 6)) XSRETURN_UNDEF; |
|
4 |
1 |
if (n == 0 && (ix >= 2 && ix <= 9 && ix != 6)) XSRETURN_UNDEF; |
|
3 |
1 |
if (n == 0 && (ix >= 2 && ix <= 9 && ix != 6)) XSRETURN_UNDEF; |
1435
|
3754 |
0 |
case 1: ret = (n < 3) ? 0 : prev_prime(n); break; |
1459
|
41 |
7 |
if ((ix == 0 || ix == 1) && _XS_get_callgmp() && PERL_REVISION >= 5 && PERL_VERSION > 8) { |
|
2 |
39 |
if ((ix == 0 || ix == 1) && _XS_get_callgmp() && PERL_REVISION >= 5 && PERL_VERSION > 8) { |
|
0 |
9 |
if ((ix == 0 || ix == 1) && _XS_get_callgmp() && PERL_REVISION >= 5 && PERL_VERSION > 8) { |
1460
|
0 |
0 |
_vcallsub_with_gmpobj(0.01, ix ? "prev_prime" : "next_prime"); |
1461
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
1486
|
0 |
15 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(svn, ST(0)); |
1517
|
294 |
418 |
if (minarg > 0 && bits < minarg) |
|
6 |
288 |
if (minarg > 0 && bits < minarg) |
1520
|
660 |
46 |
if (bits <= BITS_PER_WORD) { |
1533
|
5 |
655 |
if (res || ix == 0) XSRETURN_UV(res); |
|
2 |
3 |
if (res || ix == 0) XSRETURN_UV(res); |
1547
|
1 |
48 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
1 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
1 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
1566
|
1 |
1000 |
if (digits == 0) { |
1568
|
15 |
985 |
} else if (digits <= mantsize) { |
1583
|
0 |
972 |
if (digits <= 0) XSRETURN_EMPTY; |
1585
|
0 |
972 |
XPUSHs(sv_2mortal(newSVpvn(out, digits+1))); |
1597
|
1575 |
0 |
gimme_v = GIMME_V; |
1599
|
1401 |
174 |
if (status == 1) { |
1602
|
1 |
1400 |
UV n = my_svuv(svn); |
1603
|
52 |
1349 |
if (gimme_v == G_SCALAR) { |
1610
|
1349 |
0 |
} else if (gimme_v == G_ARRAY) { |
1613
|
99 |
0 |
EXTEND(SP, nfactors); |
|
0 |
99 |
EXTEND(SP, nfactors); |
1614
|
430 |
99 |
for (i = 0; i < nfactors; i++) |
1619
|
228 |
0 |
EXTEND(SP, nfactors); |
|
0 |
228 |
EXTEND(SP, nfactors); |
1620
|
489 |
228 |
for (i = 0; i < nfactors; i++) { |
1630
|
1022 |
0 |
EXTEND(SP, (IV)ndivisors); |
|
0 |
1022 |
EXTEND(SP, (IV)ndivisors); |
1631
|
6361 |
1022 |
for (i = 0; (UV)i < ndivisors; i++) |
1653
|
2239 |
92 |
svk = (items > 1) ? ST(1) : 0; |
1655
|
2239 |
92 |
kstatus = (items == 1 || (SvIOK(svk) && SvIV(svk) >= 0)) ? 1 : 0; |
|
1320 |
919 |
kstatus = (items == 1 || (SvIOK(svk) && SvIV(svk) >= 0)) ? 1 : 0; |
|
1320 |
0 |
kstatus = (items == 1 || (SvIOK(svk) && SvIV(svk) >= 0)) ? 1 : 0; |
|
1320 |
0 |
kstatus = (items == 1 || (SvIOK(svk) && SvIV(svk) >= 0)) ? 1 : 0; |
|
0 |
0 |
kstatus = (items == 1 || (SvIOK(svk) && SvIV(svk) >= 0)) ? 1 : 0; |
1657
|
2324 |
7 |
if (nstatus == 1 && kstatus == 0 && SvROK(svk) && (sv_isa(svk, "Math::BigInt") || sv_isa(svk, "Math::GMP") || sv_isa(svk, "Math::GMPz"))) |
|
913 |
1411 |
if (nstatus == 1 && kstatus == 0 && SvROK(svk) && (sv_isa(svk, "Math::BigInt") || sv_isa(svk, "Math::GMP") || sv_isa(svk, "Math::GMPz"))) |
|
913 |
0 |
if (nstatus == 1 && kstatus == 0 && SvROK(svk) && (sv_isa(svk, "Math::BigInt") || sv_isa(svk, "Math::GMP") || sv_isa(svk, "Math::GMPz"))) |
|
913 |
0 |
if (nstatus == 1 && kstatus == 0 && SvROK(svk) && (sv_isa(svk, "Math::BigInt") || sv_isa(svk, "Math::GMP") || sv_isa(svk, "Math::GMPz"))) |
|
913 |
0 |
if (nstatus == 1 && kstatus == 0 && SvROK(svk) && (sv_isa(svk, "Math::BigInt") || sv_isa(svk, "Math::GMP") || sv_isa(svk, "Math::GMPz"))) |
|
0 |
913 |
if (nstatus == 1 && kstatus == 0 && SvROK(svk) && (sv_isa(svk, "Math::BigInt") || sv_isa(svk, "Math::GMP") || sv_isa(svk, "Math::GMPz"))) |
1659
|
2324 |
7 |
if (nstatus == 1 && kstatus == 1) { |
|
1411 |
913 |
if (nstatus == 1 && kstatus == 1) { |
1660
|
0 |
1411 |
UV n = my_svuv(svn); |
1661
|
1320 |
91 |
UV k = (items > 1) ? my_svuv(svk) : 1; |
|
0 |
1320 |
UV k = (items > 1) ? my_svuv(svk) : 1; |
1663
|
1411 |
0 |
if (sigma != 0) XSRETURN_UV(sigma); /* sigma 0 means overflow */ |
1679
|
16599 |
2256 |
astatus = _validate_int(aTHX_ sva, (ix==1) ? 2 : 0); |
1680
|
16599 |
2256 |
nstatus = _validate_int(aTHX_ svn, (ix==1) ? 2 : 0); |
1681
|
18855 |
0 |
if (astatus != 0 && nstatus != 0) { |
|
18851 |
4 |
if (astatus != 0 && nstatus != 0) { |
1682
|
0 |
18851 |
UV a = my_svuv(sva); |
1683
|
0 |
18851 |
UV n = my_svuv(svn); |
1688
|
16562 |
37 |
case 1: if ( (astatus == 1 && (nstatus == -1 || n > a)) || |
|
16544 |
18 |
case 1: if ( (astatus == 1 && (nstatus == -1 || n > a)) || |
|
16536 |
8 |
case 1: if ( (astatus == 1 && (nstatus == -1 || n > a)) || |
|
37 |
16536 |
case 1: if ( (astatus == 1 && (nstatus == -1 || n > a)) || |
1689
|
17 |
20 |
(astatus ==-1 && (nstatus == -1 && n > a)) ) |
|
9 |
8 |
(astatus ==-1 && (nstatus == -1 && n > a)) ) |
1691
|
8 |
16556 |
if (nstatus == -1) |
1693
|
28 |
16536 |
if (astatus == -1) { |
1694
|
28 |
0 |
ret = binomial( -my_sviv(sva)+n-1, n ); |
1695
|
28 |
0 |
if (ret > 0 && ret <= (UV)IV_MAX) |
|
28 |
0 |
if (ret > 0 && ret <= (UV)IV_MAX) |
1696
|
15 |
13 |
XSRETURN_IV( (IV)ret * ((n&1) ? -1 : 1) ); |
1700
|
5232 |
11304 |
if (ret == 0) |
1705
|
22 |
468 |
if (ret == 0 && n > 1) |
|
22 |
0 |
if (ret == 0 && n > 1) |
1708
|
901 |
1 |
case 3: if (a < 1 || n < 1) XSRETURN_IV(0); |
|
1 |
900 |
case 3: if (a < 1 || n < 1) XSRETURN_IV(0); |
1712
|
676 |
224 |
if (m == 0 || a == g) RETURN_NPARITY(m); |
|
391 |
285 |
if (m == 0 || a == g) RETURN_NPARITY(m); |
|
615 |
0 |
if (m == 0 || a == g) RETURN_NPARITY(m); |
|
615 |
0 |
if (m == 0 || a == g) RETURN_NPARITY(m); |
1722
|
456 |
12211 |
if (ret == 0 && ix == 0) XSRETURN_UNDEF; /* not defined */ |
|
4 |
452 |
if (ret == 0 && ix == 0) XSRETURN_UNDEF; /* not defined */ |
1751
|
1278 |
7345 |
if (astatus != 0 && gstatus != 0 && pstatus == 1) { |
|
1269 |
9 |
if (astatus != 0 && gstatus != 0 && pstatus == 1) { |
|
1232 |
37 |
if (astatus != 0 && gstatus != 0 && pstatus == 1) { |
1752
|
128 |
1104 |
UV a, g, p = my_svuv(svp); |
1753
|
224 |
1008 |
if (p <= 1) XSRETURN_UV(0); |
1756
|
1008 |
0 |
a = (astatus == 1) ? my_svuv(sva) : negmod(my_sviv(sva), p); |
|
120 |
888 |
a = (astatus == 1) ? my_svuv(sva) : negmod(my_sviv(sva), p); |
|
0 |
0 |
a = (astatus == 1) ? my_svuv(sva) : negmod(my_sviv(sva), p); |
1757
|
888 |
120 |
g = (gstatus == 1) ? my_svuv(svg) : negmod(my_sviv(svg), p); |
|
48 |
840 |
g = (gstatus == 1) ? my_svuv(svg) : negmod(my_sviv(svg), p); |
|
120 |
0 |
g = (gstatus == 1) ? my_svuv(svg) : negmod(my_sviv(svg), p); |
1758
|
153 |
855 |
if (a >= p) a %= p; |
1759
|
52 |
956 |
if (g >= p && ix != 4) g %= p; |
|
39 |
13 |
if (g >= p && ix != 4) g %= p; |
1762
|
5 |
15 |
if (ret == 0 && a > 1) retundef = 1; |
|
3 |
2 |
if (ret == 0 && a > 1) retundef = 1; |
1763
|
5 |
15 |
if (ret == 0 && (a == 0 || g == 0)) retundef = 1; |
|
5 |
0 |
if (ret == 0 && (a == 0 || g == 0)) retundef = 1; |
|
0 |
5 |
if (ret == 0 && (a == 0 || g == 0)) retundef = 1; |
1768
|
21 |
40 |
if (g == 0) retundef = 1; |
1772
|
0 |
248 |
default:if (a == 0) { |
1776
|
30 |
218 |
if (gstatus == -1) { |
1778
|
7 |
23 |
if (a == 0) retundef = 1; |
1779
|
23 |
0 |
else g = -my_sviv(svg); |
1785
|
31 |
977 |
if (retundef) XSRETURN_UNDEF; |
1796
|
7391 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
7391 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
7391 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
7391 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
7391 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
0 |
7391 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
0 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
7391 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
0 |
7391 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
7391 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
7391 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
0 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
0 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
0 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
0 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
0 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
0 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
|
0 |
0 |
OBJECTIFY_RESULT(svp, ST(items-1)); |
1811
|
229 |
4 |
if (astatus != 0 && bstatus != 0) { |
|
227 |
2 |
if (astatus != 0 && bstatus != 0) { |
1812
|
171 |
56 |
if (ix == 0) { |
1814
|
159 |
12 |
abpositive = astatus == 1 && bstatus == 1; |
|
151 |
8 |
abpositive = astatus == 1 && bstatus == 1; |
1817
|
20 |
0 |
&& (SvIOK(sva) && !SvIsUV(sva)) |
|
19 |
1 |
&& (SvIOK(sva) && !SvIsUV(sva)) |
1818
|
20 |
151 |
&& (SvIOK(svb) && !SvIsUV(svb)); |
|
19 |
0 |
&& (SvIOK(svb) && !SvIsUV(svb)); |
|
18 |
1 |
&& (SvIOK(svb) && !SvIsUV(svb)); |
1819
|
20 |
151 |
if (abpositive || abnegative) { |
|
18 |
2 |
if (abpositive || abnegative) { |
1820
|
3 |
166 |
UV a = my_svuv(sva); |
1821
|
2 |
167 |
UV b = my_svuv(svb); |
1822
|
151 |
18 |
int k = (abpositive) ? kronecker_uu(a,b) : kronecker_ss(a,b); |
1823
|
169 |
0 |
RETURN_NPARITY(k); |
|
169 |
0 |
RETURN_NPARITY(k); |
1825
|
5 |
51 |
} else if (ix == 1) { |
1826
|
1 |
4 |
UV n = (astatus == -1) ? (UV)(-(my_sviv(sva))) : my_svuv(sva); |
|
1 |
0 |
UV n = (astatus == -1) ? (UV)(-(my_sviv(sva))) : my_svuv(sva); |
|
0 |
4 |
UV n = (astatus == -1) ? (UV)(-(my_sviv(sva))) : my_svuv(sva); |
1827
|
0 |
5 |
UV k = (bstatus == -1) ? (UV)(-(my_sviv(svb))) : my_svuv(svb); |
|
0 |
0 |
UV k = (bstatus == -1) ? (UV)(-(my_sviv(svb))) : my_svuv(svb); |
|
0 |
5 |
UV k = (bstatus == -1) ? (UV)(-(my_sviv(svb))) : my_svuv(svb); |
1829
|
5 |
0 |
RETURN_NPARITY( valuation(n, k) ); |
|
5 |
0 |
RETURN_NPARITY( valuation(n, k) ); |
1830
|
12 |
39 |
} else if (ix == 2) { |
1832
|
10 |
2 |
n = (bstatus != -1) ? my_svuv(svb) : (UV)(-(my_sviv(svb))); |
|
2 |
8 |
n = (bstatus != -1) ? my_svuv(svb) : (UV)(-(my_sviv(svb))); |
|
2 |
0 |
n = (bstatus != -1) ? my_svuv(svb) : (UV)(-(my_sviv(svb))); |
1833
|
10 |
2 |
if (n > 0) { |
1834
|
8 |
2 |
a = (astatus == 1) ? my_svuv(sva) : negmod(my_sviv(sva), n); |
|
0 |
8 |
a = (astatus == 1) ? my_svuv(sva) : negmod(my_sviv(sva), n); |
|
2 |
0 |
a = (astatus == 1) ? my_svuv(sva) : negmod(my_sviv(sva), n); |
1835
|
9 |
1 |
if (a > 0) { |
1836
|
1 |
8 |
if (n == 1) XSRETURN_UV(0); |
1840
|
4 |
7 |
if (ret == 0) XSRETURN_UNDEF; |
1842
|
12 |
27 |
} else if (ix == 3) { |
1844
|
12 |
0 |
n = (bstatus != -1) ? my_svuv(svb) : (UV)(-(my_sviv(svb))); |
|
0 |
12 |
n = (bstatus != -1) ? my_svuv(svb) : (UV)(-(my_sviv(svb))); |
|
0 |
0 |
n = (bstatus != -1) ? my_svuv(svb) : (UV)(-(my_sviv(svb))); |
1845
|
10 |
2 |
a = (n == 0) ? 0 : (astatus != -1) ? my_svuv(sva) % n : negmod(my_sviv(sva), n); |
|
10 |
0 |
a = (n == 0) ? 0 : (astatus != -1) ? my_svuv(sva) % n : negmod(my_sviv(sva), n); |
|
0 |
10 |
a = (n == 0) ? 0 : (astatus != -1) ? my_svuv(sva) % n : negmod(my_sviv(sva), n); |
|
0 |
0 |
a = (n == 0) ? 0 : (astatus != -1) ? my_svuv(sva) % n : negmod(my_sviv(sva), n); |
1846
|
5 |
7 |
if (is_prob_prime(n)) { |
1847
|
0 |
5 |
if (!sqrtmod(&s, a, n)) XSRETURN_UNDEF; |
1849
|
2 |
5 |
if (!sqrtmod_composite(&s, a, n)) XSRETURN_UNDEF; |
1854
|
26 |
1 |
n = (bstatus != -1) ? my_svuv(svb) : (UV)(-(my_sviv(svb))); |
|
2 |
24 |
n = (bstatus != -1) ? my_svuv(svb) : (UV)(-(my_sviv(svb))); |
|
1 |
0 |
n = (bstatus != -1) ? my_svuv(svb) : (UV)(-(my_sviv(svb))); |
1855
|
26 |
1 |
a = (n == 0) ? 0 : (astatus != -1) ? my_svuv(sva) % n : negmod(my_sviv(sva), n); |
|
26 |
0 |
a = (n == 0) ? 0 : (astatus != -1) ? my_svuv(sva) % n : negmod(my_sviv(sva), n); |
|
0 |
26 |
a = (n == 0) ? 0 : (astatus != -1) ? my_svuv(sva) % n : negmod(my_sviv(sva), n); |
|
0 |
0 |
a = (n == 0) ? 0 : (astatus != -1) ? my_svuv(sva) % n : negmod(my_sviv(sva), n); |
1856
|
27 |
0 |
RETURN_NPARITY( is_primitive_root(a,n,0) ); |
|
27 |
0 |
RETURN_NPARITY( is_primitive_root(a,n,0) ); |
1877
|
10 |
4 |
if ( (astatus == 1 && SvIsUV(sva)) || (astatus == -1 && !SvIOK(sva)) ) |
|
9 |
1 |
if ( (astatus == 1 && SvIsUV(sva)) || (astatus == -1 && !SvIOK(sva)) ) |
|
3 |
10 |
if ( (astatus == 1 && SvIsUV(sva)) || (astatus == -1 && !SvIOK(sva)) ) |
|
0 |
3 |
if ( (astatus == 1 && SvIsUV(sva)) || (astatus == -1 && !SvIOK(sva)) ) |
1879
|
10 |
4 |
if ( (bstatus == 1 && SvIsUV(svb)) || (bstatus == -1 && !SvIOK(svb)) ) |
|
10 |
0 |
if ( (bstatus == 1 && SvIsUV(svb)) || (bstatus == -1 && !SvIOK(svb)) ) |
|
3 |
11 |
if ( (bstatus == 1 && SvIsUV(svb)) || (bstatus == -1 && !SvIOK(svb)) ) |
|
0 |
3 |
if ( (bstatus == 1 && SvIsUV(svb)) || (bstatus == -1 && !SvIOK(svb)) ) |
1881
|
12 |
2 |
if (astatus != 0 && bstatus != 0) { |
|
12 |
0 |
if (astatus != 0 && bstatus != 0) { |
1883
|
12 |
0 |
IV a = my_sviv(sva); |
1884
|
12 |
0 |
IV b = my_sviv(svb); |
1886
|
0 |
12 |
XPUSHs(sv_2mortal(newSViv( u ))); |
1887
|
0 |
12 |
XPUSHs(sv_2mortal(newSViv( v ))); |
1888
|
0 |
12 |
XPUSHs(sv_2mortal(newSViv( d ))); |
1890
|
2 |
0 |
_vcallsubn(aTHX_ GIMME_V, VCALL_PP, "gcdext", items, 0); |
1897
|
1288 |
255 |
if (type != 1 && type != 2 && type != 3) |
|
253 |
1035 |
if (type != 1 && type != 2 && type != 3) |
|
1 |
252 |
if (type != 1 && type != 2 && type != 3) |
1899
|
63 |
1479 |
if (n == m) |
1901
|
1476 |
3 |
else if (n == 0 || m == 0 || m > n) |
|
1416 |
60 |
else if (n == 0 || m == 0 || m > n) |
|
61 |
1355 |
else if (n == 0 || m == 0 || m > n) |
1903
|
190 |
1165 |
else if (type == 3) { |
1905
|
185 |
5 |
if (s != 0) XSRETURN_UV(s); |
1906
|
973 |
192 |
} else if (type == 2) { |
1908
|
509 |
464 |
if (s != 0) XSRETURN_IV(s); |
1909
|
192 |
0 |
} else if (type == 1) { |
1911
|
145 |
47 |
if (s != 0) XSRETURN_IV(s); |
1914
|
27 |
489 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
27 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
27 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
27 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
1927
|
44 |
20 |
nv = SvNV(x); |
1948
|
36 |
28155 |
histatus = (svhi == 0 || _validate_int(aTHX_ svhi, 1)); |
|
35 |
1 |
histatus = (svhi == 0 || _validate_int(aTHX_ svhi, 1)); |
1949
|
28155 |
36 |
if (svhi == 0 && lostatus != 0) { |
|
28144 |
11 |
if (svhi == 0 && lostatus != 0) { |
1951
|
74 |
28070 |
if (ix == 0) { |
1952
|
73 |
1 |
UV ret = (lostatus == -1) ? 0 : totient(my_svuv(svlo)); |
|
0 |
73 |
UV ret = (lostatus == -1) ? 0 : totient(my_svuv(svlo)); |
1955
|
20 |
28050 |
UV n = (lostatus == -1) ? (UV)(-(my_sviv(svlo))) : my_svuv(svlo); |
|
20 |
0 |
UV n = (lostatus == -1) ? (UV)(-(my_sviv(svlo))) : my_svuv(svlo); |
|
0 |
28050 |
UV n = (lostatus == -1) ? (UV)(-(my_sviv(svlo))) : my_svuv(svlo); |
1956
|
28070 |
0 |
RETURN_NPARITY(moebius(n)); |
|
28070 |
0 |
RETURN_NPARITY(moebius(n)); |
1958
|
36 |
11 |
} else if (items == 2 && lostatus == 1 && histatus == 1) { |
|
33 |
3 |
} else if (items == 2 && lostatus == 1 && histatus == 1) { |
|
32 |
1 |
} else if (items == 2 && lostatus == 1 && histatus == 1) { |
1960
|
0 |
32 |
UV lo = my_svuv(svlo); |
1961
|
0 |
32 |
UV hi = my_svuv(svhi); |
1962
|
31 |
1 |
if (lo <= hi) { |
1964
|
31 |
0 |
EXTEND(SP, (IV)(hi-lo+1)); |
|
3 |
28 |
EXTEND(SP, (IV)(hi-lo+1)); |
1965
|
8 |
23 |
if (ix == 0) { |
1966
|
1 |
7 |
UV arraylo = (lo < 100) ? 0 : lo; |
1968
|
286 |
8 |
for (i = lo; i <= hi; i++) |
1974
|
27886 |
23 |
for (i = lo; i <= hi; i++) |
1975
|
27886 |
0 |
PUSH_NPARITY(mu[i-lo]); |
|
27886 |
0 |
PUSH_NPARITY(mu[i-lo]); |
1981
|
15 |
0 |
U32 gimme_v = GIMME_V; |
1983
|
12 |
3 |
if (ix == 1 && lostatus == 1 && histatus == 1) flags |= VCALL_GMP; |
|
0 |
12 |
if (ix == 1 && lostatus == 1 && histatus == 1) flags |= VCALL_GMP; |
|
0 |
0 |
if (ix == 1 && lostatus == 1 && histatus == 1) flags |= VCALL_GMP; |
1984
|
3 |
12 |
switch (ix) { |
2011
|
1586 |
7 |
if (status != 0) { |
2012
|
2 |
1584 |
UV r, n = my_svuv(svn); |
2017
|
2 |
58 |
int nfactors = factor(my_svuv(svn), factors); |
2018
|
30 |
30 |
RETURN_NPARITY( (nfactors & 1) ? -1 : 1 ); } |
|
60 |
0 |
RETURN_NPARITY( (nfactors & 1) ? -1 : 1 ); } |
|
60 |
0 |
RETURN_NPARITY( (nfactors & 1) ? -1 : 1 ); } |
2023
|
678 |
302 |
if (r != 0) XSRETURN_UV(r); |
2026
|
20 |
1 |
case 7: XSRETURN_UV( (status == -1) ? 1 : exp_mangoldt(n) ); break; |
2027
|
2 |
23 |
case 8: if (status == -1) n = -(IV)n; |
2029
|
5 |
20 |
if (r == 0 && n != 1) XSRETURN_UNDEF; /* No root */ |
|
4 |
1 |
if (r == 0 && n != 1) XSRETURN_UNDEF; /* No root */ |
2031
|
1 |
6 |
case 9: if (status == -1) n = -(IV)n; |
2033
|
96 |
1 |
case 10: XSRETURN_IV( (status == -1) ? 0 : hclassno(n) ); break; |
2034
|
0 |
0 |
case 11: RETURN_NPARITY( (status == -1) ? 0 : pillai_v(n) ); break; |
|
0 |
0 |
case 11: RETURN_NPARITY( (status == -1) ? 0 : pillai_v(n) ); break; |
|
0 |
0 |
case 11: RETURN_NPARITY( (status == -1) ? 0 : pillai_v(n) ); break; |
2036
|
10 |
0 |
default: { IV tau = (status == 1) ? ramanujan_tau(n) : 0; |
2037
|
5 |
5 |
if (tau != 0 || status == -1 || n == 0) |
|
5 |
0 |
if (tau != 0 || status == -1 || n == 0) |
|
1 |
4 |
if (tau != 0 || status == -1 || n == 0) |
2053
|
0 |
2 |
case 9: if (_XS_get_callgmp() >= 47) { /* Very fast */ |
2056
|
2 |
0 |
char* ptr; STRLEN len; ptr = SvPV(svn, len); |
2073
|
1 |
5 |
if (n == 0) |
2075
|
5 |
0 |
if (n < 32 && _validate_int(aTHX_ svk, 1) == 1) { |
|
5 |
0 |
if (n < 32 && _validate_int(aTHX_ svk, 1) == 1) { |
2076
|
0 |
5 |
k = my_svuv(svk); |
2077
|
5 |
0 |
if (num_to_perm(k, n, S)) { |
2079
|
5 |
0 |
EXTEND(SP, (IV)n); |
|
0 |
5 |
EXTEND(SP, (IV)n); |
2080
|
45 |
5 |
for (i = 0; i < (int)n; i++) |
2081
|
45 |
0 |
PUSH_NPARITY( S[i] ); |
|
45 |
0 |
PUSH_NPARITY( S[i] ); |
2085
|
0 |
0 |
_vcallsubn(aTHX_ GIMME_V, VCALL_PP|VCALL_GMP, "numtoperm", items, 47); |
2095
|
6 |
0 |
if ((!SvROK(svp)) || (SvTYPE(SvRV(svp)) != SVt_PVAV)) |
|
0 |
6 |
if ((!SvROK(svp)) || (SvTYPE(SvRV(svp)) != SVt_PVAV)) |
2099
|
6 |
0 |
if (plen < 32) { |
2101
|
68 |
6 |
for (i = 0; i <= plen; i++) { |
2103
|
68 |
0 |
if (iv == 0 || _validate_int(aTHX_ *iv, 1) != 1) break; |
|
68 |
0 |
if (iv == 0 || _validate_int(aTHX_ *iv, 1) != 1) break; |
2104
|
0 |
68 |
val = my_svuv(*iv); |
2105
|
68 |
0 |
if (val > (UV)plen || A[val] != 0) break; |
|
68 |
0 |
if (val > (UV)plen || A[val] != 0) break; |
2109
|
6 |
0 |
if (i > plen && perm_to_num(plen+1, V, &num)) |
|
4 |
2 |
if (i > plen && perm_to_num(plen+1, V, &num)) |
2113
|
1 |
1 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
1 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
1 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
1 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
|
0 |
0 |
OBJECTIFY_RESULT(ST(0), ST(0)); |
2122
|
3 |
1 |
if (items == 1) k = n; |
2123
|
0 |
4 |
if (k > n) k = n; |
2124
|
1 |
3 |
if (k == 0) XSRETURN_EMPTY; |
2125
|
0 |
3 |
New(0, S, k, UV); |
2127
|
3 |
0 |
EXTEND(SP, (IV)k); |
|
0 |
3 |
EXTEND(SP, (IV)k); |
2128
|
105 |
3 |
for (i = 0; i < k; i++) { |
2129
|
105 |
0 |
if (n < 2*CINTS) PUSH_NPARITY(S[i]); |
|
105 |
0 |
if (n < 2*CINTS) PUSH_NPARITY(S[i]); |
|
105 |
0 |
if (n < 2*CINTS) PUSH_NPARITY(S[i]); |
2141
|
1 |
2 |
if (items == 0) |
2143
|
99 |
2 |
for (i = 0, randcxt = MY_CXT.randcxt; i < items-1; i++) { |
2156
|
0 |
1007 |
base = (ibase == 255) ? 10 : ibase; |
2157
|
1007 |
0 |
if (base < 2 || base > 36) croak("sumdigits: invalid base %"UVuf, base); |
|
0 |
1007 |
if (base < 2 || base > 36) croak("sumdigits: invalid base %"UVuf, base); |
2160
|
1007 |
0 |
if (base == 10 && SVNUMTEST(svn) && (SvIsUV(svn) || SvIVX(svn) >= 0)) { |
|
1001 |
6 |
if (base == 10 && SVNUMTEST(svn) && (SvIsUV(svn) || SvIVX(svn) >= 0)) { |
|
1001 |
0 |
if (base == 10 && SVNUMTEST(svn) && (SvIsUV(svn) || SvIVX(svn) >= 0)) { |
|
1001 |
0 |
if (base == 10 && SVNUMTEST(svn) && (SvIsUV(svn) || SvIVX(svn) >= 0)) { |
2161
|
0 |
1001 |
UV n, t = my_svuv(svn); |
2162
|
2893 |
1001 |
while ((n=t)) { |
2168
|
3 |
3 |
s = SvPV(svn, len); |
2170
|
6 |
0 |
if (ibase == 255 && len > 2 && s[0] == '0' && (s[1] == 'x' || s[1] == 'b')){ |
|
6 |
0 |
if (ibase == 255 && len > 2 && s[0] == '0' && (s[1] == 'x' || s[1] == 'b')){ |
|
1 |
5 |
if (ibase == 255 && len > 2 && s[0] == '0' && (s[1] == 'x' || s[1] == 'b')){ |
|
0 |
1 |
if (ibase == 255 && len > 2 && s[0] == '0' && (s[1] == 'x' || s[1] == 'b')){ |
|
0 |
0 |
if (ibase == 255 && len > 2 && s[0] == '0' && (s[1] == 'x' || s[1] == 'b')){ |
2171
|
1 |
0 |
base = (s[1] == 'x') ? 16 : 2; |
2175
|
38634 |
6 |
for (i = 0; i < len; i++) { |
2178
|
38631 |
3 |
if (c >= '0' && c <= '9') { d = c - '0'; } |
|
38629 |
2 |
if (c >= '0' && c <= '9') { d = c - '0'; } |
2179
|
1 |
4 |
else if (c >= 'a' && c <= 'z') { d = c - 'a' + 10; } |
|
1 |
0 |
else if (c >= 'a' && c <= 'z') { d = c - 'a' + 10; } |
2180
|
1 |
3 |
else if (c >= 'A' && c <= 'Z') { d = c - 'A' + 10; } |
|
1 |
0 |
else if (c >= 'A' && c <= 'Z') { d = c - 'A' + 10; } |
2181
|
38634 |
0 |
if (d < base) |
2195
|
0 |
38 |
if (base < 2) croak("invalid base: %d", base); |
2197
|
22 |
16 |
if (ix == 0 || ix == 1) { |
|
3 |
19 |
if (ix == 0 || ix == 1) { |
2199
|
17 |
2 |
n = (status == 0) ? 0 : status * my_svuv(svn); |
|
0 |
17 |
n = (status == 0) ? 0 : status * my_svuv(svn); |
2202
|
16 |
22 |
if (ix == 0 && status != 0 && length < 128) { |
|
14 |
2 |
if (ix == 0 && status != 0 && length < 128) { |
|
14 |
0 |
if (ix == 0 && status != 0 && length < 128) { |
2205
|
14 |
0 |
if (len >= 0) { |
2207
|
14 |
0 |
EXTEND(SP, len); |
|
0 |
14 |
EXTEND(SP, len); |
2208
|
89 |
14 |
for (i = 0; i < len; i++) |
2209
|
89 |
0 |
PUSH_NPARITY( digits[len-i-1] ); |
|
89 |
0 |
PUSH_NPARITY( digits[len-i-1] ); |
2214
|
3 |
21 |
if (ix == 1 && status != 0 && length < 128) { |
|
3 |
0 |
if (ix == 1 && status != 0 && length < 128) { |
|
3 |
0 |
if (ix == 1 && status != 0 && length < 128) { |
2217
|
3 |
0 |
if (len >= 0) { |
2218
|
0 |
3 |
XPUSHs(sv_2mortal(newSVpv(s, len))); |
2223
|
19 |
2 |
if ((ix == 0 || ix == 1) && base == 10 && length < 0) { |
|
0 |
19 |
if ((ix == 0 || ix == 1) && base == 10 && length < 0) { |
|
1 |
1 |
if ((ix == 0 || ix == 1) && base == 10 && length < 0) { |
|
1 |
0 |
if ((ix == 0 || ix == 1) && base == 10 && length < 0) { |
2225
|
1 |
0 |
str = SvPV(svn, len); |
2226
|
0 |
1 |
if (ix == 1) { |
2227
|
0 |
0 |
XPUSHs(sv_2mortal(newSVpv(str, len))); |
2230
|
0 |
1 |
if (len == 1 && str[0] == '0') XSRETURN(0); |
|
0 |
0 |
if (len == 1 && str[0] == '0') XSRETURN(0); |
2233
|
1 |
0 |
EXTEND(SP, (IV)len); |
|
0 |
1 |
EXTEND(SP, (IV)len); |
2234
|
45 |
1 |
for (i = 0; i < (int)len; i++) |
2235
|
45 |
0 |
PUSH_NPARITY(str[i]-'0'); |
|
45 |
0 |
PUSH_NPARITY(str[i]-'0'); |
2239
|
19 |
1 |
if (ix == 2) { /* fromdigits */ |
2240
|
6 |
13 |
if (!SvROK(svn)) { /* string */ |
2241
|
6 |
0 |
if (from_digit_string(&n, SvPV_nolen(svn), base)) { |
|
5 |
1 |
if (from_digit_string(&n, SvPV_nolen(svn), base)) { |
2244
|
13 |
0 |
} else if (!_is_sv_bigint(aTHX_ svn)) { /* array ref of digits */ |
2247
|
13 |
0 |
if (from_digit_to_UV(&n, r, len, base)) { |
2250
|
0 |
0 |
} else if (from_digit_to_str(&str, r, len, base)){ |
2252
|
0 |
0 |
XPUSHs( sv_to_bigint(aTHX_ sv_2mortal(newSVpv(str,0))) ); |
2260
|
1 |
0 |
case 0: _vcallsubn(aTHX_ GIMME_V, VCALL_GMP|VCALL_PP, "todigits", items, 41); break; |
2280
|
1875 |
125 |
if (_validate_int(aTHX_ svn, 0)) { |
2281
|
78 |
1797 |
if (SvROK(svn)) { /* Convert small Math::BigInt object into scalar */ |
2282
|
0 |
78 |
UV n = my_svuv(svn); |
2289
|
3 |
1872 |
if (items > 1 && ((sv1 = ST(1)), SvOK(sv1))) { |
|
0 |
3 |
if (items > 1 && ((sv1 = ST(1)), SvOK(sv1))) { |
|
0 |
0 |
if (items > 1 && ((sv1 = ST(1)), SvOK(sv1))) { |
|
0 |
0 |
if (items > 1 && ((sv1 = ST(1)), SvOK(sv1))) { |
|
3 |
0 |
if (items > 1 && ((sv1 = ST(1)), SvOK(sv1))) { |
2290
|
0 |
3 |
UV n = my_svuv(svn); |
2291
|
0 |
3 |
UV min = my_svuv(sv1); |
2292
|
0 |
3 |
if (n < min) |
2294
|
0 |
3 |
if (items > 2 && ((sv2 = ST(2)), SvOK(sv2))) { |
|
0 |
0 |
if (items > 2 && ((sv2 = ST(2)), SvOK(sv2))) { |
|
0 |
0 |
if (items > 2 && ((sv2 = ST(2)), SvOK(sv2))) { |
|
0 |
0 |
if (items > 2 && ((sv2 = ST(2)), SvOK(sv2))) { |
|
0 |
0 |
if (items > 2 && ((sv2 = ST(2)), SvOK(sv2))) { |
2295
|
0 |
0 |
UV max = my_svuv(sv2); |
2296
|
0 |
0 |
if (n > max) |
2298
|
0 |
0 |
MPUassert( items <= 3, "_validate_num takes at most 3 parameters"); |
2312
|
0 |
89 |
if (MY_CXT.forcount == 0) croak("lastfor called outside a loop"); |
2352
|
0 |
73 |
if (cv == Nullcv) |
2355
|
68 |
0 |
if (!_validate_int(aTHX_ svbeg, 0) || (items >= 3 && !_validate_int(aTHX_ svend,0))) { |
|
31 |
37 |
if (!_validate_int(aTHX_ svbeg, 0) || (items >= 3 && !_validate_int(aTHX_ svend,0))) { |
|
0 |
28 |
if (!_validate_int(aTHX_ svbeg, 0) || (items >= 3 && !_validate_int(aTHX_ svend,0))) { |
2360
|
37 |
28 |
if (items < 3) { |
2362
|
0 |
37 |
end = my_svuv(svbeg); |
2364
|
0 |
28 |
beg = my_svuv(svbeg); |
2365
|
0 |
28 |
end = my_svuv(svend); |
2373
|
123 |
64 |
while (beg < 6) { |
2374
|
85 |
38 |
beg = (beg <= 2) ? 2 : (beg <= 3) ? 3 : 5; |
|
41 |
44 |
beg = (beg <= 2) ? 2 : (beg <= 3) ? 3 : 5; |
2375
|
116 |
7 |
if (beg <= end) { |
2377
|
0 |
116 |
PUSHMARK(SP); |
2379
|
1 |
115 |
CHECK_FORCOUNT; |
2381
|
84 |
38 |
beg += 1 + (beg > 2); |
2384
|
65 |
0 |
if (!CvISXSUB(cv) && beg <= end) { |
|
58 |
7 |
if (!CvISXSUB(cv) && beg <= end) { |
2387
|
0 |
58 |
PUSH_MULTICALL(cv); |
|
0 |
58 |
PUSH_MULTICALL(cv); |
2388
|
0 |
58 |
if ( |
2390
|
0 |
0 |
(beg >= UVCONST( 100000000000000) && end-beg < 100000) || |
|
0 |
58 |
(beg >= UVCONST( 100000000000000) && end-beg < 100000) || |
2391
|
0 |
0 |
(beg >= UVCONST( 10000000000000) && end-beg < 40000) || |
|
0 |
58 |
(beg >= UVCONST( 10000000000000) && end-beg < 40000) || |
2392
|
0 |
0 |
(beg >= UVCONST( 1000000000000) && end-beg < 17000) || |
|
31 |
27 |
(beg >= UVCONST( 1000000000000) && end-beg < 17000) || |
2395
|
141 |
30 |
for (beg = next_prime(beg-1); beg <= end && beg != 0; beg = next_prime(beg)) { |
|
141 |
0 |
for (beg = next_prime(beg-1); beg <= end && beg != 0; beg = next_prime(beg)) { |
2396
|
1 |
140 |
CHECK_FORCOUNT; |
2402
|
27 |
2 |
while (next_segment_primes(ctx, &seg_base, &seg_low, &seg_high)) { |
2403
|
0 |
27 |
int crossuv = (seg_high > IV_MAX) && !SvIsUV(svarg); |
|
0 |
0 |
int crossuv = (seg_high > IV_MAX) && !SvIsUV(svarg); |
2404
|
1266 |
0 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
2 |
1264 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
1261 |
3 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
1266 |
17 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
133 |
27 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
2405
|
114 |
1147 |
CHECK_FORCOUNT; |
2407
|
165 |
982 |
if (SvTYPE(svarg) != SVt_IV) { sv_setuv(svarg, p); } |
2408
|
0 |
982 |
else if (crossuv && p > IV_MAX) { sv_setuv(svarg, p); crossuv=0; } |
|
0 |
0 |
else if (crossuv && p > IV_MAX) { sv_setuv(svarg, p); crossuv=0; } |
2412
|
25 |
2 |
CHECK_FORCOUNT; |
2417
|
58 |
0 |
POP_MULTICALL; |
|
0 |
58 |
POP_MULTICALL; |
2421
|
0 |
7 |
if (beg <= end) { /* NO-MULTICALL segment sieve */ |
2423
|
0 |
0 |
while (next_segment_primes(ctx, &seg_base, &seg_low, &seg_high)) { |
2424
|
0 |
0 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
0 |
0 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
0 |
0 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
0 |
0 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
0 |
0 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
2425
|
0 |
0 |
CHECK_FORCOUNT; |
2427
|
0 |
0 |
PUSHMARK(SP); |
2430
|
0 |
0 |
CHECK_FORCOUNT; |
2435
|
0 |
65 |
END_FORCOUNT; |
2454
|
0 |
58 |
if (cv == Nullcv) |
2457
|
58 |
0 |
if (!_validate_int(aTHX_ svbeg, 0) || (items >= 3 && !_validate_int(aTHX_ svend,0))) { |
|
2 |
56 |
if (!_validate_int(aTHX_ svbeg, 0) || (items >= 3 && !_validate_int(aTHX_ svend,0))) { |
|
0 |
2 |
if (!_validate_int(aTHX_ svbeg, 0) || (items >= 3 && !_validate_int(aTHX_ svend,0))) { |
2458
|
0 |
0 |
_vcallsubn(aTHX_ G_VOID|G_DISCARD, VCALL_ROOT, (ix == 0) ? "_generic_forcomposites" : "_generic_foroddcomposites", items, 0); |
2462
|
56 |
2 |
if (items < 3) { |
2463
|
26 |
30 |
beg = ix ? 8 : 4; |
2464
|
0 |
56 |
end = my_svuv(svbeg); |
2466
|
0 |
2 |
beg = my_svuv(svbeg); |
2467
|
0 |
2 |
end = my_svuv(svend); |
2475
|
58 |
0 |
if (!CvISXSUB(cv) && end >= beg) { |
|
56 |
2 |
if (!CvISXSUB(cv) && end >= beg) { |
2481
|
0 |
56 |
PUSH_MULTICALL(cv); |
|
0 |
56 |
PUSH_MULTICALL(cv); |
2482
|
56 |
0 |
if (beg >= MPU_MAX_PRIME || |
|
0 |
56 |
if (beg >= MPU_MAX_PRIME || |
2484
|
0 |
0 |
(beg >= UVCONST( 100000000000000) && end-beg < 120000) || |
|
0 |
56 |
(beg >= UVCONST( 100000000000000) && end-beg < 120000) || |
2485
|
0 |
0 |
(beg >= UVCONST( 10000000000000) && end-beg < 50000) || |
|
0 |
56 |
(beg >= UVCONST( 10000000000000) && end-beg < 50000) || |
2486
|
0 |
0 |
(beg >= UVCONST( 1000000000000) && end-beg < 20000) || |
|
55 |
1 |
(beg >= UVCONST( 1000000000000) && end-beg < 20000) || |
2489
|
27 |
28 |
beg = (beg <= 4) ? 3 : beg-1; |
2491
|
3953 |
5 |
while (beg++ < end) { |
2492
|
907 |
3046 |
if (beg == nextprime) nextprime = next_prime(beg); |
2493
|
2083 |
963 |
else if (!ix || beg & 1) { sv_setuv(svarg, beg); MULTICALL; } |
|
753 |
1330 |
else if (!ix || beg & 1) { sv_setuv(svarg, beg); MULTICALL; } |
2494
|
50 |
3903 |
CHECK_FORCOUNT; |
2497
|
1 |
0 |
if (ix) { |
2498
|
0 |
1 |
if (beg < 8) beg = 8; |
2499
|
0 |
0 |
} else if (beg <= 4) { /* sieve starts at 7, so handle this here */ |
2506
|
1 |
0 |
nextprime = (end >= MPU_MAX_PRIME) ? MPU_MAX_PRIME : next_prime(end); |
2508
|
1 |
1 |
while (next_segment_primes(ctx, &seg_base, &seg_low, &seg_high)) { |
2509
|
0 |
1 |
int crossuv = (seg_high > IV_MAX) && !SvIsUV(svarg); |
|
0 |
0 |
int crossuv = (seg_high > IV_MAX) && !SvIsUV(svarg); |
2510
|
6468 |
0 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
1 |
6467 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
6466 |
1 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
6468 |
269 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
|
270 |
1 |
START_DO_FOR_EACH_SIEVE_PRIME( segment, seg_base, seg_low, seg_high ) |
2511
|
0 |
6466 |
CHECK_FORCOUNT; |
2513
|
0 |
6466 |
if (cbeg < beg) |
2514
|
0 |
0 |
cbeg = beg - (ix == 1 && (beg % 2)); |
|
0 |
0 |
cbeg = beg - (ix == 1 && (beg % 2)); |
2516
|
1 |
6465 |
cend = prevprime-1; if (cend > end) cend = end; |
2518
|
25872 |
6466 |
for (c = cbeg + ix; c <= cend; c=c+1+ix) { |
2519
|
0 |
25872 |
if (SvTYPE(svarg) != SVt_IV) { sv_setuv(svarg,c); } |
2520
|
0 |
25872 |
else if (crossuv && c > IV_MAX) { sv_setuv(svarg,c); crossuv=0;} |
|
0 |
0 |
else if (crossuv && c > IV_MAX) { sv_setuv(svarg,c); crossuv=0;} |
2527
|
0 |
1 |
if (end > nextprime) /* Complete the case where end > max_prime */ |
2528
|
0 |
0 |
while (nextprime++ < end) |
2529
|
0 |
0 |
if (!ix || nextprime & 1) { |
|
0 |
0 |
if (!ix || nextprime & 1) { |
2530
|
0 |
0 |
CHECK_FORCOUNT; |
2536
|
56 |
0 |
POP_MULTICALL; |
|
0 |
56 |
POP_MULTICALL; |
2540
|
0 |
2 |
if (beg <= end) { |
2541
|
0 |
0 |
beg = (beg <= 4) ? 3 : beg-1; |
2542
|
0 |
0 |
while (beg++ < end) { |
2543
|
0 |
0 |
if ((!ix || beg&1) && !is_prob_prime(beg)) { |
|
0 |
0 |
if ((!ix || beg&1) && !is_prob_prime(beg)) { |
|
0 |
0 |
if ((!ix || beg&1) && !is_prob_prime(beg)) { |
2545
|
0 |
0 |
PUSHMARK(SP); |
2547
|
0 |
0 |
CHECK_FORCOUNT; |
2552
|
0 |
58 |
END_FORCOUNT; |
2570
|
0 |
71 |
if (cv == Nullcv) |
2573
|
0 |
71 |
if (!_validate_int(aTHX_ svn, 0)) { |
2578
|
0 |
71 |
n = my_svuv(svn); |
2586
|
71 |
0 |
if (!CvISXSUB(cv)) { |
2589
|
0 |
71 |
PUSH_MULTICALL(cv); |
|
0 |
71 |
PUSH_MULTICALL(cv); |
2590
|
272 |
64 |
for (i = 0; i < ndivisors; i++) { |
2593
|
7 |
265 |
CHECK_FORCOUNT; |
2596
|
71 |
0 |
POP_MULTICALL; |
|
0 |
71 |
POP_MULTICALL; |
2601
|
0 |
0 |
for (i = 0; i < ndivisors; i++) { |
2603
|
0 |
0 |
PUSHMARK(SP); |
2605
|
0 |
0 |
CHECK_FORCOUNT; |
2610
|
0 |
71 |
END_FORCOUNT; |
2630
|
0 |
34 |
if (cv == Nullcv) |
2632
|
0 |
34 |
if (!_validate_int(aTHX_ svn, 0)) { |
2636
|
0 |
34 |
n = my_svuv(svn); |
2637
|
0 |
34 |
if (n > (UV_MAX-2)) croak("forpart argument overflow"); |
2639
|
0 |
34 |
New(0, svals, n+1, SV*); |
2640
|
673 |
34 |
for (i = 0; i <= n; i++) { |
2646
|
16 |
18 |
if (svh != 0) { |
2649
|
16 |
0 |
if (!SvROK(svh) || SvTYPE(SvRV(svh)) != SVt_PVHV) |
|
0 |
16 |
if (!SvROK(svh) || SvTYPE(SvRV(svh)) != SVt_PVHV) |
2652
|
8 |
8 |
if ((svp = hv_fetchs(rhash, "n", 0)) != NULL) |
2653
|
0 |
8 |
{ nmin = my_svuv(*svp); nmax = nmin; } |
2654
|
9 |
7 |
if ((svp = hv_fetchs(rhash, "amin", 0)) != NULL) amin = my_svuv(*svp); |
|
0 |
9 |
if ((svp = hv_fetchs(rhash, "amin", 0)) != NULL) amin = my_svuv(*svp); |
2655
|
5 |
11 |
if ((svp = hv_fetchs(rhash, "amax", 0)) != NULL) amax = my_svuv(*svp); |
|
0 |
5 |
if ((svp = hv_fetchs(rhash, "amax", 0)) != NULL) amax = my_svuv(*svp); |
2656
|
2 |
14 |
if ((svp = hv_fetchs(rhash, "nmin", 0)) != NULL) nmin = my_svuv(*svp); |
|
0 |
2 |
if ((svp = hv_fetchs(rhash, "nmin", 0)) != NULL) nmin = my_svuv(*svp); |
2657
|
2 |
14 |
if ((svp = hv_fetchs(rhash, "nmax", 0)) != NULL) nmax = my_svuv(*svp); |
|
0 |
2 |
if ((svp = hv_fetchs(rhash, "nmax", 0)) != NULL) nmax = my_svuv(*svp); |
2658
|
3 |
13 |
if ((svp = hv_fetchs(rhash, "prime",0)) != NULL) primeq=my_svuv(*svp); |
|
0 |
3 |
if ((svp = hv_fetchs(rhash, "prime",0)) != NULL) primeq=my_svuv(*svp); |
2660
|
0 |
16 |
if (amin < 1) amin = 1; |
2661
|
0 |
16 |
if (amax > n) amax = n; |
2662
|
0 |
16 |
if (nmin < 1) nmin = 1; |
2663
|
0 |
16 |
if (nmax > n) nmax = n; |
2664
|
15 |
1 |
if (primeq != 0 && primeq != -1) primeq = 2; /* -1, 0, or 2 */ |
|
2 |
13 |
if (primeq != 0 && primeq != -1) primeq = 2; /* -1, 0, or 2 */ |
2667
|
2 |
32 |
if (primeq == 2) { |
2669
|
1 |
1 |
UV next = amin <= 2 ? 2 : next_prime(amin-1); |
2670
|
0 |
2 |
if (amin < next) amin = next; |
2671
|
0 |
2 |
if (amax > prev) amax = prev; |
2674
|
2 |
32 |
if (n==0 && nmin <= 1) { |
|
2 |
0 |
if (n==0 && nmin <= 1) { |
2675
|
0 |
2 |
{ dSP; ENTER; PUSHMARK(SP); |
2680
|
32 |
2 |
if (n >= nmin && nmin <= nmax && amin <= amax && nmax > 0 && amax > 0) |
|
32 |
0 |
if (n >= nmin && nmin <= nmax && amin <= amax && nmax > 0 && amax > 0) |
|
31 |
1 |
if (n >= nmin && nmin <= nmax && amin <= amax && nmax > 0 && amax > 0) |
|
31 |
0 |
if (n >= nmin && nmin <= nmax && amin <= amax && nmax > 0 && amax > 0) |
|
31 |
0 |
if (n >= nmin && nmin <= nmax && amin <= amax && nmax > 0 && amax > 0) |
2683
|
0 |
31 |
New(0, a, n+1, UV); |
2688
|
15843 |
17 |
while (k != 0) { |
2692
|
15786 |
57 |
r = (ix == 0) ? x : 1; |
2693
|
20374 |
15843 |
while (r <= y) { |
2701
|
4548 |
15843 |
while (k+1 > nmax) { /* Skip range if over max size */ |
2706
|
3617 |
12226 |
if (k+1 < nmin) { /* Skip if not over min size */ |
2707
|
9 |
3608 |
if (a[0] >= n-nmin+1 && a[k] > 1) break; /* early exit check */ |
|
9 |
0 |
if (a[0] >= n-nmin+1 && a[k] > 1) break; /* early exit check */ |
2712
|
9389 |
2837 |
if (amin > 1 || amax < n) { |
|
615 |
8774 |
if (amin > 1 || amax < n) { |
2714
|
3 |
3449 |
if (a[0] > amax) break; |
2716
|
3428 |
21 |
if (ix == 0) { /* value restrictions for partitions */ |
2717
|
578 |
2850 |
if (a[k] > amax) continue; |
2720
|
51 |
7 |
for (i = 0; i <= k; i++) |
2721
|
44 |
7 |
if (a[i] < amin || a[i] > amax) |
|
37 |
7 |
if (a[i] < amin || a[i] > amax) |
2723
|
14 |
7 |
if (i <= k) continue; |
2726
|
2602 |
9029 |
if (primeq != -1) { |
2727
|
2510 |
1189 |
for (i = 0; i <= k; i++) if (is_prime(a[i]) != primeq) break; |
|
3699 |
92 |
for (i = 0; i <= k; i++) if (is_prime(a[i]) != primeq) break; |
2728
|
2510 |
92 |
if (i <= k) continue; |
2731
|
0 |
9121 |
{ dSP; ENTER; PUSHMARK(SP); |
2732
|
9121 |
0 |
EXTEND(SP, (IV)k); for (i = 0; i <= k; i++) { PUSHs(svals[a[i]]); } |
|
0 |
9121 |
EXTEND(SP, (IV)k); for (i = 0; i <= k; i++) { PUSHs(svals[a[i]]); } |
|
75999 |
9121 |
EXTEND(SP, (IV)k); for (i = 0; i <= k; i++) { PUSHs(svals[a[i]]); } |
2735
|
2 |
9119 |
CHECK_FORCOUNT; |
2738
|
0 |
31 |
END_FORCOUNT; |
2740
|
673 |
34 |
for (i = 0; i <= n; i++) |
2763
|
0 |
24 |
if (cv == Nullcv) |
2765
|
13 |
11 |
if (ix > 0 && svk != 0) |
|
0 |
13 |
if (ix > 0 && svk != 0) |
2768
|
24 |
0 |
if (!_validate_int(aTHX_ svn, 0) || (svk != 0 && !_validate_int(aTHX_ svk, 0))) { |
|
8 |
16 |
if (!_validate_int(aTHX_ svn, 0) || (svk != 0 && !_validate_int(aTHX_ svk, 0))) { |
|
0 |
8 |
if (!_validate_int(aTHX_ svn, 0) || (svk != 0 && !_validate_int(aTHX_ svk, 0))) { |
2769
|
0 |
0 |
_vcallsub_with_pp( (ix == 0) ? "forcomb" |
|
0 |
0 |
_vcallsub_with_pp( (ix == 0) ? "forcomb" |
2775
|
0 |
24 |
n = my_svuv(svn); |
2776
|
16 |
8 |
if (svk == 0) { |
2777
|
13 |
3 |
begk = (ix == 0) ? 0 : n; |
2780
|
0 |
8 |
begk = endk = my_svuv(svk); |
2781
|
1 |
7 |
if (begk > n) |
2785
|
0 |
23 |
New(0, svals, n, SV*); |
2786
|
92 |
23 |
for (i = 0; i < n; i++) { |
2790
|
0 |
23 |
New(0, cm, endk+1, UV); |
2793
|
27 |
20 |
for (k = begk; k <= endk; k++) { |
2795
|
80 |
27 |
for (i = 0; i < k; i++) |
2797
|
6 |
21 |
if (ix == 2 && k >= 2) { /* Make derangements start deranged */ |
|
4 |
2 |
if (ix == 2 && k >= 2) { /* Make derangements start deranged */ |
2798
|
19 |
4 |
for (i = 0; i < k; i++) |
2799
|
11 |
8 |
cm[k-i-1] = (i&1) ? i : i+2; |
2800
|
3 |
1 |
if (k & 1) { |
2806
|
1865 |
20622 |
if (ix < 2 || k != 1) { |
|
1864 |
1 |
if (ix < 2 || k != 1) { |
2807
|
0 |
22486 |
dSP; ENTER; PUSHMARK(SP); |
2808
|
22486 |
0 |
EXTEND(SP, ((IV)k)); |
|
0 |
22486 |
EXTEND(SP, ((IV)k)); |
2809
|
281154 |
22486 |
for (i = 0; i < k; i++) { PUSHs(svals[ cm[k-i-1]-1 ]); } |
2811
|
3 |
22483 |
CHECK_FORCOUNT; |
2813
|
15534 |
6950 |
if (ix == 0) { |
2814
|
3887 |
11647 |
if (cm[0]++ < n) continue; /* Increment last value */ |
2815
|
38777 |
13 |
for (i = 1; i < k && cm[i] >= n-i; i++) ; /* Find next index to incr */ |
|
27143 |
11634 |
for (i = 1; i < k && cm[i] >= n-i; i++) ; /* Find next index to incr */ |
2816
|
13 |
11634 |
if (i >= k) break; /* Done! */ |
2818
|
38753 |
11634 |
while (i-- > 0) cm[i] = cm[i+1] + 1; /* Set the rest */ |
2819
|
5086 |
1864 |
} else if (ix == 1) { |
2820
|
8730 |
6 |
for (j = 1; j < k && cm[j] > cm[j-1]; j++) ; /* Find last decrease */ |
|
3650 |
5080 |
for (j = 1; j < k && cm[j] > cm[j-1]; j++) ; /* Find last decrease */ |
2821
|
6 |
5080 |
if (j >= k) break; /* Done! */ |
2822
|
1818 |
5080 |
for (m = 0; cm[j] > cm[m]; m++) ; /* Find next greater */ |
2824
|
2753 |
5080 |
for (i = j-1, m = 0; m < i; i--, m++) /* Reverse the end */ |
2828
|
5000 |
5 |
for (j = 1; j < k && cm[j] > cm[j-1]; j++) ; /* Find last decrease */ |
|
2268 |
2732 |
for (j = 1; j < k && cm[j] > cm[j-1]; j++) ; /* Find last decrease */ |
2829
|
5 |
2732 |
if (j >= k) break; /* Done! */ |
2830
|
1134 |
2732 |
for (m = 0; cm[j] > cm[m]; m++) ; /* Find next greater */ |
2832
|
536 |
2196 |
if (cm[j] == k-j) goto REDERANGE; /* Skip? */ |
2833
|
1371 |
2196 |
for (i = j-1, m = 0; m < i; i--, m++) /* Reverse the end */ |
2835
|
15261 |
1859 |
for (i = 0; i < k; i++) /* Check deranged */ |
2836
|
337 |
14924 |
if (cm[k-i-1]-1 == i) |
2838
|
337 |
1859 |
if (i != k) goto REDERANGE; |
2841
|
3 |
24 |
CHECK_FORCOUNT; |
2845
|
92 |
23 |
for (i = 0; i < n; i++) |
2848
|
0 |
23 |
END_FORCOUNT; |
2862
|
0 |
4 |
if (cv == Nullcv) croak("Not a subroutine reference"); |
2863
|
1 |
3 |
if (items <= 1) XSRETURN_UNDEF; |
2870
|
3 |
0 |
SvSetMagicSV(ret, args[1]); |
|
0 |
3 |
SvSetMagicSV(ret, args[1]); |
2872
|
3 |
0 |
if (!CvISXSUB(cv)) { |
2875
|
0 |
3 |
PUSH_MULTICALL(cv); |
|
0 |
3 |
PUSH_MULTICALL(cv); |
2876
|
4 |
3 |
for (i = 2; i < items; i++) { |
2879
|
4 |
0 |
SvSetMagicSV(ret, *PL_stack_sp); |
|
0 |
4 |
SvSetMagicSV(ret, *PL_stack_sp); |
2882
|
3 |
0 |
POP_MULTICALL; |
|
0 |
3 |
POP_MULTICALL; |
2887
|
0 |
0 |
for (i = 2; i < items; i++) { |
2890
|
0 |
0 |
PUSHMARK(SP); |
2892
|
0 |
0 |
SvSetMagicSV(ret, *PL_stack_sp); |
|
0 |
0 |
SvSetMagicSV(ret, *PL_stack_sp); |
2918
|
0 |
27 |
if (cv == Nullcv) croak("Not a subroutine reference"); |
2922
|
27 |
0 |
if (!CvISXSUB(cv)) { |
2926
|
0 |
27 |
PUSH_MULTICALL(cv); |
|
0 |
27 |
PUSH_MULTICALL(cv); |
2927
|
5040 |
17 |
for (index = 1; index < items; index++) { |
2930
|
5040 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
5040 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
5040 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
5032 |
8 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
5032 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
5032 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
5016 |
16 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
5016 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
5016 |
16 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
8 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
8 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
8 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
8 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
8 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
10 |
5030 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
2934
|
27 |
0 |
POP_MULTICALL; |
|
0 |
27 |
POP_MULTICALL; |
2939
|
0 |
0 |
for (index = 1; index < items; index++) { |
2942
|
0 |
0 |
PUSHMARK(SP); |
2944
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
|
0 |
0 |
if (SvTRUEx(*PL_stack_sp) ^ invert) |
2949
|
5 |
22 |
if (ix == 4) { |
2950
|
2 |
3 |
if (index == items) |
2955
|
5 |
17 |
if (ix == 6) { |
2956
|
2 |
3 |
if (index == items) |
2961
|
4 |
13 |
if (index != items) /* We exited the loop early */ |
2964
|
11 |
6 |
if (ret_true) XSRETURN_YES; |