summaryrefslogtreecommitdiff
path: root/lib/Math/BigInt/t
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Math/BigInt/t')
-rw-r--r--lib/Math/BigInt/t/bare_mbf.t2
-rw-r--r--lib/Math/BigInt/t/bigfltpm.inc25
-rwxr-xr-xlib/Math/BigInt/t/bigfltpm.t2
-rw-r--r--lib/Math/BigInt/t/fallback.t14
-rwxr-xr-xlib/Math/BigInt/t/sub_mbf.t2
-rw-r--r--lib/Math/BigInt/t/with_sub.t2
6 files changed, 32 insertions, 15 deletions
diff --git a/lib/Math/BigInt/t/bare_mbf.t b/lib/Math/BigInt/t/bare_mbf.t
index 7428535ed6..1ff4b52c27 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 => 2200;
+ plan tests => 2226;
}
use Math::BigFloat lib => 'BareCalc';
diff --git a/lib/Math/BigInt/t/bigfltpm.inc b/lib/Math/BigInt/t/bigfltpm.inc
index c99cc7066c..873a4ca356 100644
--- a/lib/Math/BigInt/t/bigfltpm.inc
+++ b/lib/Math/BigInt/t/bigfltpm.inc
@@ -119,6 +119,12 @@ while (<DATA>)
$try .= '$x ** $y;';
} elsif ($f eq "bnok") {
$try .= '$x->bnok($y);';
+ } elsif ($f eq "bcos") {
+ $try .= '$x->bcos($y);';
+ } elsif ($f eq "bsin") {
+ $try .= '$x->bsin($y);';
+ } elsif ($f eq "batan") {
+ $try .= '$x->batan($y);';
} elsif ($f eq "froot") {
$try .= "$setup; \$x->froot(\$y);";
} elsif ($f eq "fadd") {
@@ -142,9 +148,9 @@ while (<DATA>)
$try .= "\$z = $class->new(\"$args[2]\");";
if( $f eq "bmodpow") {
- $try .= "\$x->bmodpow(\$y,\$z);";
+ $try .= '$x->bmodpow($y,$z);';
} elsif ($f eq "bmuladd"){
- $try .= "\$x->bmuladd(\$y,\$z);";
+ $try .= '$x->bmuladd($y,$z);';
} else { warn "Unknown op '$f'"; }
}
}
@@ -410,6 +416,21 @@ abc:+0:NaN
+27:+90:270
+1034:+804:415668
$div_scale = 40;
+&bcos
+1.2:10:0.3623577545
+2.4:12:-0.737393715541
+0:10:1
+0:20:1
+1:10:0.5403023059
+1:12:0.540302305868
+&bsin
+1:10:0.8414709848
+0:10:0
+0:20:0
+2.1:12:0.863209366649
+1.2:13:0.9320390859672
+0.2:13:0.1986693307951
+3.2:12:-0.0583741434276
&bpi
77:3.1415926535897932384626433832795028841971693993751058209749445923078164062862
+0:3.141592653589793238462643383279502884197
diff --git a/lib/Math/BigInt/t/bigfltpm.t b/lib/Math/BigInt/t/bigfltpm.t
index 1b9127eac7..bcaf6e1be7 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 => 2200
+ plan tests => 2226
+ 5; # own tests
}
diff --git a/lib/Math/BigInt/t/fallback.t b/lib/Math/BigInt/t/fallback.t
index 010ff8a592..c69a3ff672 100644
--- a/lib/Math/BigInt/t/fallback.t
+++ b/lib/Math/BigInt/t/fallback.t
@@ -28,7 +28,7 @@ BEGIN
}
print "# INC = @INC\n";
- plan tests => 9;
+ plan tests => 7;
}
# The tests below test that cos(BigInt) = cos(Scalar) which is DWIM, but not
@@ -41,18 +41,14 @@ use Math::BigFloat;
my $bi = Math::BigInt->new(1);
-ok (cos($bi), cos(1));
-ok (sin($bi), sin(1));
+ok (cos($bi), int(cos(1)));
+ok (sin($bi), int(sin(1)));
ok (atan2($bi,$bi), atan2(1,1));
my $bf = Math::BigInt->new(0);
-ok (cos($bf), cos(0));
-ok (sin($bf), sin(0));
+ok (cos($bf), int(cos(0)));
+ok (sin($bf), int(sin(0)));
ok (atan2($bi,$bf), atan2(1,0));
ok (atan2($bf,$bi), atan2(0,1));
-my $bone = Math::BigInt->new(1);
-ok (cos($bone), cos(1));
-ok (sin($bone), sin(1));
-
diff --git a/lib/Math/BigInt/t/sub_mbf.t b/lib/Math/BigInt/t/sub_mbf.t
index 08b1ae4954..8c15747129 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 => 2200
+ plan tests => 2226
+ 6; # + our own tests
}
diff --git a/lib/Math/BigInt/t/with_sub.t b/lib/Math/BigInt/t/with_sub.t
index a8d3ec8345..695fb080d7 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 => 2200
+ plan tests => 2226
+ 1;
}