9 unshift @INC, '../lib'; # for running manually
10 my $location = $0; $location =~ s/bigintpm.t//;
11 unshift @INC, $location; # to locate the testing files
13 plan tests => 3273 + 6;
16 use Math::BigInt lib => 'Calc';
18 use vars qw ($scale $class $try $x $y $f @args $ans $ans1 $ans1_str $setup $CL);
19 $class = "Math::BigInt";
20 $CL = "Math::BigInt::Calc";
22 #############################################################################
23 # from_hex(), from_bin() and from_oct() tests
25 my $x = Math::BigInt->from_hex('0xcafe');
26 ok ($x, "51966", 'from_hex() works');
28 $x = Math::BigInt->from_hex('0xcafebabedead');
29 ok ($x, "223195403574957", 'from_hex() works with long numbers');
31 $x = Math::BigInt->from_bin('0b1001');
32 ok ($x, "9", 'from_bin() works');
34 $x = Math::BigInt->from_bin('0b1001100110011001100110011001');
35 ok ($x, "161061273", 'from_bin() works with big numbers');
37 $x = Math::BigInt->from_oct('0775');
38 ok ($x, "509", 'from_oct() works');
40 $x = Math::BigInt->from_oct('07777777777777711111111222222222');
41 ok ($x, "9903520314281112085086151826", 'from_oct() works with big numbers');
43 #############################################################################
46 require 'bigintpm.inc'; # all tests here for sharing