1N/A if ($^O eq 'os390') { print "1..0\n"; exit(0) } # test takes too long there 1N/A chdir 't' if -d 't'; 1N/Amy $c = 'Math::BigInt'; 1N/A# If you get a failure here, please re-run the test with the printed seed 1N/A # we create the numbers from "patterns", e.g. get a random number and a 1N/A # random count and string them together. This means things like 1N/A # "100000999999999999911122222222" are much more likely. If we just strung 1N/A # together digits, we would end up with "1272398823211223" etc. It also means 1N/A # that we get more frequently equal numbers or other special cases. 1N/A # print "# As $As\n# Bs $Bs\n"; 1N/A # print "# A $A\n# B $B\n"; 1N/A for (1..4) { ok (1,1); } next; 1N/A # check that int(A/B)*B + A % B == A holds for all inputs 1N/A # $X = ($A/$B)*$B + 2 * ($A % $B) - ($A % $B); 1N/A# print "# ($A / $B, $A % $B ) = $ADB $AMB\n"; 1N/A print "# seed: $seed, \$ADB * \$B / \$B = ", $ADB * $B / $B, " != $ADB (\$B=$B)\n" 1N/A # swap 'em and try this, too 1N/A # $X = ($B/$A)*$A + $B % $A; 1N/A #print "check: $ADB $AMB"; 1N/A# print " +$two * $AMB = ",$ADB * $A + $two * $AMB,"\n"; 1N/A# print " -$AMB = ",$ADB * $A + $two * $AMB - $AMB,"\n"; 1N/A print "# seed $seed, \$ADB * \$A / \$A = ", $ADB * $A / $A, " != $ADB (\$A=$A)\n"