3 ###############################################################################
12 unshift @INC, '../lib';
18 ###############################################################################
41 my ($x,$y) = split /:/;
43 ok (bigint::_constant("$x"),"$y");
46 ###############################################################################
49 my $x = 5; ok (ref($x) =~ /^Math::BigInt/); # :constant
51 # todo: ok (2 + 2.5,4.5); # should still work
52 # todo: $x = 2 + 3.5; ok (ref($x),'Math::BigFloat');
54 $x = 2 ** 255; ok (ref($x) =~ /^Math::BigInt/);
56 ok (12->bfac(),479001600);
59 ok (4.5+4.5,8); # truncate
60 ok (ref(4.5+4.5) =~ /^Math::BigInt/);
63 ###############################################################################
64 # accurarcy and precision
66 ok_undef (bigint->accuracy());
67 ok (bigint->accuracy(12),12);
68 ok (bigint->accuracy(),12);
70 ok_undef (bigint->precision());
71 ok (bigint->precision(12),12);
72 ok (bigint->precision(),12);
74 ok (bigint->round_mode(),'even');
75 ok (bigint->round_mode('odd'),'odd');
76 ok (bigint->round_mode(),'odd');
78 ###############################################################################
79 ###############################################################################
80 # Perl 5.005 does not like ok ($x,undef)
86 ok (1,1) and return if !defined $x;