3 ###############################################################################
12 unshift @INC, '../lib';
18 ###############################################################################
41 my ($x,$y) = split /:/;
43 ok (bigint::_float_constant("$x"),"$y");
53 my ($x,$y) = split /:/;
55 ok (bigint::_binary_constant("$x"),"$y");
58 ###############################################################################
61 my $x = 5; ok (ref($x) =~ /^Math::BigInt/); # :constant
63 # todo: ok (2 + 2.5,4.5); # should still work
64 # todo: $x = 2 + 3.5; ok (ref($x),'Math::BigFloat');
66 $x = 2 ** 255; ok (ref($x) =~ /^Math::BigInt/);
68 ok (12->bfac(),479001600);
71 ok (4.5+4.5,8); # truncate
72 ok (ref(4.5+4.5) =~ /^Math::BigInt/);
75 ###############################################################################
76 # accurarcy and precision
78 ok_undef (bigint->accuracy());
79 ok (bigint->accuracy(12),12);
80 ok (bigint->accuracy(),12);
82 ok_undef (bigint->precision());
83 ok (bigint->precision(12),12);
84 ok (bigint->precision(),12);
86 ok (bigint->round_mode(),'even');
87 ok (bigint->round_mode('odd'),'odd');
88 ok (bigint->round_mode(),'odd');
90 ###############################################################################
91 ###############################################################################
92 # Perl 5.005 does not like ok ($x,undef)
98 ok (1,1) and return if !defined $x;