This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Math::BigInt 1.75, by Tels
[perl5.git] / lib / Math / BigInt / t / fallback.t
index e348d92..00f1dfd 100644 (file)
@@ -28,11 +28,11 @@ BEGIN
     }
   print "# INC = @INC\n";
 
-  plan tests => 8;
+  plan tests => 12;
   }
 
 # The tests below test that cos(BigInt) = cos(Scalar) which is DWIM, but not
-# exactly right, ideally cos(BigInt) should truncate to int() and cos(BigFLoat)
+# exactly right, ideally cos(BigInt) should truncate to int() and cos(BigFloat)
 # should calculate the result to X digits accuracy. For now, this is better
 # than die()ing...
 
@@ -46,10 +46,16 @@ ok (sin($bi), sin(1));
 ok (exp($bi), exp(1));
 ok (atan2($bi,$bi), atan2(1,1));
 
-my $bf = Math::BigInt->new(1);
+my $bf = Math::BigInt->new(0);
 
-ok (cos($bf), cos(1));
-ok (sin($bf), sin(1));
-ok (exp($bf), exp(1));
-ok (atan2($bf,$bf), atan2(1,1));
+ok (cos($bf), cos(0));
+ok (sin($bf), sin(0));
+ok (exp($bf), exp(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));
+ok (exp($bone), exp(1));