BEGIN {
chdir 't' if -d 't';
- unshift @INC, '../lib';
+ @INC = '../lib';
}
use Math::BigInt;
$test = 0;
$| = 1;
-print "1..247\n";
+print "1..283\n";
while (<DATA>) {
chop;
if (s/^&//) {
$try .= "-\$x;";
} elsif ($f eq "babs") {
$try .= "abs \$x;";
+ } elsif ($f eq "bint") {
+ $try .= "int \$x;";
} else {
$try .= "\$y = new Math::BigInt \"$args[1]\";";
if ($f eq "bcmp"){
print "# '$try' expected: '$ans' got: '$ans1'\n";
}
}
-}
+}
+
+{
+ use Math::BigInt(0.02,':constant');
+
+ $test++;
+ print "not "
+ unless 2**150 eq "+1427247692705959881058285969449495136382746624";
+ print "ok $test\n";
+ $test++;
+ @a = ();
+ for ($i = 1; $i < 10; $i++) {
+ push @a, $i;
+ }
+ print "not " unless "@a" eq "+1 +2 +3 +4 +5 +6 +7 +8 +9";
+ print "ok $test\n";
+}
+
__END__
&bnorm
abc:NaN
+0:-1
+8:-9
+281474976710656:-281474976710657
+&bint
++0:+0
++1:+1
++11111111111111111234:+11111111111111111234
+-1:-1
+-11111111111111111234:-11111111111111111234