$| = 1;
chdir 't' if -d 't';
unshift @INC, '../lib'; # for running manually
- plan tests => 159;
+ plan tests => 164;
}
# testing of Math::BigRat
$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
$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