diff options
author | Tels <nospam-abuse@bloodgate.com> | 2007-06-09 16:07:34 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-06-11 15:20:38 +0000 |
commit | 80365507967096955316527fd22b32ea3dc94765 (patch) | |
tree | 0a51d493413d251488250b7bb20e595008d89a36 /lib/Math/BigInt/t | |
parent | fdb4b05f1f9ef1d9dc6361348b4be14d11ea44f4 (diff) | |
download | perl-80365507967096955316527fd22b32ea3dc94765.tar.gz |
Math::BigInt v1.87 take 8
Message-Id: <200706091407.36659@bloodgate.com>
p4raw-id: //depot/perl@31365
Diffstat (limited to 'lib/Math/BigInt/t')
-rw-r--r-- | lib/Math/BigInt/t/bare_mbf.t | 2 | ||||
-rw-r--r-- | lib/Math/BigInt/t/bare_mbi.t | 2 | ||||
-rw-r--r-- | lib/Math/BigInt/t/bigfltpm.inc | 78 | ||||
-rwxr-xr-x | lib/Math/BigInt/t/bigfltpm.t | 2 | ||||
-rw-r--r-- | lib/Math/BigInt/t/bigintpm.inc | 64 | ||||
-rwxr-xr-x | lib/Math/BigInt/t/bigintpm.t | 2 | ||||
-rwxr-xr-x | lib/Math/BigInt/t/sub_mbf.t | 2 | ||||
-rwxr-xr-x | lib/Math/BigInt/t/sub_mbi.t | 2 | ||||
-rw-r--r-- | lib/Math/BigInt/t/with_sub.t | 2 |
9 files changed, 147 insertions, 9 deletions
diff --git a/lib/Math/BigInt/t/bare_mbf.t b/lib/Math/BigInt/t/bare_mbf.t index b2f1fd0a18..7428535ed6 100644 --- a/lib/Math/BigInt/t/bare_mbf.t +++ b/lib/Math/BigInt/t/bare_mbf.t @@ -27,7 +27,7 @@ BEGIN } print "# INC = @INC\n"; - plan tests => 2070; + plan tests => 2200; } use Math::BigFloat lib => 'BareCalc'; diff --git a/lib/Math/BigInt/t/bare_mbi.t b/lib/Math/BigInt/t/bare_mbi.t index 7c359c8948..793fd6956c 100644 --- a/lib/Math/BigInt/t/bare_mbi.t +++ b/lib/Math/BigInt/t/bare_mbi.t @@ -26,7 +26,7 @@ BEGIN } print "# INC = @INC\n"; - plan tests => 3099; + plan tests => 3217; } use Math::BigInt lib => 'BareCalc'; diff --git a/lib/Math/BigInt/t/bigfltpm.inc b/lib/Math/BigInt/t/bigfltpm.inc index 7e71d7a7c6..c99cc7066c 100644 --- a/lib/Math/BigInt/t/bigfltpm.inc +++ b/lib/Math/BigInt/t/bigfltpm.inc @@ -137,7 +137,16 @@ while (<DATA>) $try .= '$x << $y;'; } elsif ($f eq "fmod") { $try .= '$x % $y;'; - } else { warn "Unknown op '$f'"; } + } else { + # Functions with three arguments + $try .= "\$z = $class->new(\"$args[2]\");"; + + if( $f eq "bmodpow") { + $try .= "\$x->bmodpow(\$y,\$z);"; + } elsif ($f eq "bmuladd"){ + $try .= "\$x->bmuladd(\$y,\$z);"; + } else { warn "Unknown op '$f'"; } + } } # print "# Trying: '$try'\n"; $ans1 = eval $try; @@ -1204,6 +1213,73 @@ baddNaN:+inf:NaN -123456789:+987654321:-1111111110 -123456789:-987654321:864197532 +123456789:-987654321:1111111110 +&bmuladd +abc:abc:0:NaN +abc:+0:0:NaN ++0:abc:0:NaN ++0:0:abc:NaN +NaNmul:+inf:0:NaN +NaNmul:-inf:0:NaN +-inf:NaNmul:0:NaN ++inf:NaNmul:0:NaN ++inf:+inf:0:inf ++inf:-inf:0:-inf +-inf:+inf:0:-inf +-inf:-inf:0:inf ++0:+0:0:0 ++0:+1:0:0 ++1:+0:0:0 ++0:-1:0:0 +-1:+0:0:0 +123456789123456789:0:0:0 +0:123456789123456789:0:0 +-1:-1:0:1 +-1:-1:0:1 +-1:+1:0:-1 ++1:-1:0:-1 ++1:+1:0:1 ++2:+3:0:6 +-2:+3:0:-6 ++2:-3:0:-6 +-2:-3:0:6 +111:111:0:12321 +10101:10101:0:102030201 +1001001:1001001:0:1002003002001 +100010001:100010001:0:10002000300020001 +10000100001:10000100001:0:100002000030000200001 +11111111111:9:0:99999999999 +22222222222:9:0:199999999998 +33333333333:9:0:299999999997 +44444444444:9:0:399999999996 +55555555555:9:0:499999999995 +66666666666:9:0:599999999994 +77777777777:9:0:699999999993 +88888888888:9:0:799999999992 +99999999999:9:0:899999999991 +11111111111:9:1:100000000000 +22222222222:9:1:199999999999 +33333333333:9:1:299999999998 +44444444444:9:1:399999999997 +55555555555:9:1:499999999996 +66666666666:9:1:599999999995 +77777777777:9:1:699999999994 +88888888888:9:1:799999999993 +99999999999:9:1:899999999992 +-3:-4:-5:7 +3:-4:-5:-17 +-3:4:-5:-17 +3:4:-5:7 +-3:4:5:-7 +3:-4:5:-7 +9999999999999999999:10000000000000000000:1234567890:99999999999999999990000000001234567890 +3.2:5.7:8.9:27.14 +-3.2:5.197:6.05:-10.5804 +&bmodpow +3:4:8:1 +3:4:7:4 +3:4:7:4 +77777:777:123456789:99995084 +3.2:6.2:5.2:2.970579856718063040273642739529400818 &fmul abc:abc:NaN abc:+0:NaN diff --git a/lib/Math/BigInt/t/bigfltpm.t b/lib/Math/BigInt/t/bigfltpm.t index 1645663f1c..1b9127eac7 100755 --- a/lib/Math/BigInt/t/bigfltpm.t +++ b/lib/Math/BigInt/t/bigfltpm.t @@ -26,7 +26,7 @@ BEGIN } print "# INC = @INC\n"; - plan tests => 2070 + plan tests => 2200 + 5; # own tests } diff --git a/lib/Math/BigInt/t/bigintpm.inc b/lib/Math/BigInt/t/bigintpm.inc index b2065c6d65..dbcb469e47 100644 --- a/lib/Math/BigInt/t/bigintpm.inc +++ b/lib/Math/BigInt/t/bigintpm.inc @@ -177,11 +177,13 @@ while (<DATA>) }elsif ($f eq "digit"){ $try .= "\$x->digit(\$y);"; } else { + # Functions with three arguments $try .= "\$z = $class->new(\"$args[2]\");"; - # Functions with three arguments if( $f eq "bmodpow") { $try .= "\$x->bmodpow(\$y,\$z);"; + } elsif ($f eq "bmuladd"){ + $try .= "\$x->bmuladd(\$y,\$z);"; } else { warn "Unknown op '$f'"; } } } # end else all other ops @@ -1395,6 +1397,66 @@ abc:+0:NaN 100000000001:-1:100000000002 1000000000001:-1:1000000000002 10000000000001:-1:10000000000002 +&bmuladd +abc:abc:0:NaN +abc:+0:0:NaN ++0:abc:0:NaN ++0:0:abc:NaN +NaNmul:+inf:0:NaN +NaNmul:-inf:0:NaN +-inf:NaNmul:0:NaN ++inf:NaNmul:0:NaN ++inf:+inf:0:inf ++inf:-inf:0:-inf +-inf:+inf:0:-inf +-inf:-inf:0:inf ++0:+0:0:0 ++0:+1:0:0 ++1:+0:0:0 ++0:-1:0:0 +-1:+0:0:0 +123456789123456789:0:0:0 +0:123456789123456789:0:0 +-1:-1:0:1 +-1:-1:0:1 +-1:+1:0:-1 ++1:-1:0:-1 ++1:+1:0:1 ++2:+3:0:6 +-2:+3:0:-6 ++2:-3:0:-6 +-2:-3:0:6 +111:111:0:12321 +10101:10101:0:102030201 +1001001:1001001:0:1002003002001 +100010001:100010001:0:10002000300020001 +10000100001:10000100001:0:100002000030000200001 +11111111111:9:0:99999999999 +22222222222:9:0:199999999998 +33333333333:9:0:299999999997 +44444444444:9:0:399999999996 +55555555555:9:0:499999999995 +66666666666:9:0:599999999994 +77777777777:9:0:699999999993 +88888888888:9:0:799999999992 +99999999999:9:0:899999999991 +11111111111:9:1:100000000000 +22222222222:9:1:199999999999 +33333333333:9:1:299999999998 +44444444444:9:1:399999999997 +55555555555:9:1:499999999996 +66666666666:9:1:599999999995 +77777777777:9:1:699999999994 +88888888888:9:1:799999999993 +99999999999:9:1:899999999992 +-3:-4:-5:7 +3:-4:-5:-17 +-3:4:-5:-17 +3:4:-5:7 +-3:4:5:-7 +3:-4:5:-7 +9999999999999999999:10000000000000000000:1234567890:99999999999999999990000000001234567890 +2:3:12345678901234567890:12345678901234567896 &bmul abc:abc:NaN abc:+0:NaN diff --git a/lib/Math/BigInt/t/bigintpm.t b/lib/Math/BigInt/t/bigintpm.t index f8e2edaa07..86a41c58d6 100755 --- a/lib/Math/BigInt/t/bigintpm.t +++ b/lib/Math/BigInt/t/bigintpm.t @@ -10,7 +10,7 @@ BEGIN my $location = $0; $location =~ s/bigintpm.t//; unshift @INC, $location; # to locate the testing files chdir 't' if -d 't'; - plan tests => 3099; + plan tests => 3217; } use Math::BigInt lib => 'Calc'; diff --git a/lib/Math/BigInt/t/sub_mbf.t b/lib/Math/BigInt/t/sub_mbf.t index 5f25de80f4..08b1ae4954 100755 --- a/lib/Math/BigInt/t/sub_mbf.t +++ b/lib/Math/BigInt/t/sub_mbf.t @@ -26,7 +26,7 @@ BEGIN } print "# INC = @INC\n"; - plan tests => 2070 + plan tests => 2200 + 6; # + our own tests } diff --git a/lib/Math/BigInt/t/sub_mbi.t b/lib/Math/BigInt/t/sub_mbi.t index f35b819f55..b9c598acd0 100755 --- a/lib/Math/BigInt/t/sub_mbi.t +++ b/lib/Math/BigInt/t/sub_mbi.t @@ -26,7 +26,7 @@ BEGIN } print "# INC = @INC\n"; - plan tests => 3099 + plan tests => 3217 + 5; # +5 own tests } diff --git a/lib/Math/BigInt/t/with_sub.t b/lib/Math/BigInt/t/with_sub.t index c8c9fc993e..a8d3ec8345 100644 --- a/lib/Math/BigInt/t/with_sub.t +++ b/lib/Math/BigInt/t/with_sub.t @@ -28,7 +28,7 @@ BEGIN } print "# INC = @INC\n"; - plan tests => 2070 + plan tests => 2200 + 1; } |