Upgrade BigInt and BigRat
[p5sagit/p5-mst-13.2.git] / lib / Math / BigRat / t / bigrat.t
index dd6f8ad..ae38555 100755 (executable)
@@ -8,7 +8,7 @@ BEGIN
   $| = 1;
   chdir 't' if -d 't';
   unshift @INC, '../lib'; # for running manually
-  plan tests => 159;
+  plan tests => 164;
   }
 
 # testing of Math::BigRat
@@ -162,8 +162,20 @@ ok ($x*$y,'3/7');
 $x = $cr->new('3/5');          $y = $cr->new('5/7');
 ok ($x/$y,'21/25');
 
+$x = $cr->new('7/4');          $y = $cr->new('1');
+ok ($x % $y,'3/4');
+
+$x = $cr->new('7/4');          $y = $cr->new('5/13');
+ok ($x % $y,'11/52');
+
+$x = $cr->new('7/4');          $y = $cr->new('5/9');
+ok ($x % $y,'1/12');
+
 $x = $cr->new('-144/9')->bsqrt();      ok ($x,'NaN');
 $x = $cr->new('144/9')->bsqrt();       ok ($x,'4');
+$x = $cr->new('3/4')->bsqrt();         ok ($x,
+  '1732050807568877293527446341505872366943/'
+ .'2000000000000000000000000000000000000000');
 
 ##############################################################################
 # bpow
@@ -222,6 +234,8 @@ $x = $cr->new('inf'); ok ($x->numify(), 'inf');
 $x = $cr->new('-inf'); ok ($x->numify(), '-inf');
 $x = $cr->new('NaN'); ok ($x->numify(), 'NaN');
 
+$x = $cr->new('4/3'); ok ($x->numify(), 4/3);
+
 ##############################################################################
 # done