|
BEGIN { plan tests => 133 }
use Inline Config => DIRECTORY => './blib_test' ; my $ovfl = $Config {intsize} <= 4 ? "Integer too large for architecture" : 0;
sub fact {
my $num = shift ;
my $skip = shift || 0;
return fact_help( $num , 1, $skip );
}
ok(fact(1), 1);
ok(fact(2), 2);
ok(fact(3), 6);
ok(fact(4), 24);
ok(fact(5), 120);
ok(fact(6), 720);
ok(fact(7), 5040);
ok(fact(8), 40320);
ok(fact(9), 362880);
ok(fact(10), 3628800);
skip( $ovfl , fact(11, $ovfl ), 39916800);
skip( $ovfl , fact(12, $ovfl ), 479001600);
skip( $ovfl , fact(13, $ovfl ), 6227020800);
skip( $ovfl , fact(14, $ovfl ), 87178291200);
|