Johanafm running your code, for the last test I actually get 8118 on my 64bit system not 1971, however it does return correctly on 32bit (who woulda thunk). When I tried to use your class in the code I posted (instead of Brad's function) I got all wrong answers heh, so I must have tried to use it wrong. I tried like this:
function InTheHole($n1,$n2,$n4) {
$part1 = Int32::mu($n1,$n2);
$part2 = Int32::ad($n4,6);
$part3 = Int32::mu($part1,$part2);
$part4 = Int32::ad($n4,29);
$part5 = Int32::ad($part3,$part4);
$n3 = Int32::di($part5,$n1);
$n3 = Int32::mu($n3,$n1);
while( $n3 > 9999 )
$n3 = Int32::su($n3,8888);
while( $n3 < 1000 )
$n3 = Int32::ad($n3,1237);
return $n3;
}
I then got different answers on both systems. 32bit returned:
Expected to get: 2443
Actually got: 2109
Expected to get: 8480
Actually got: 1961
Expected to get: 2805
Actually got: 1234
Expected to get: 1971
Actually got: 1971
While 64bit returned:
Expected to get: 2443
Actually got: 1803
Expected to get: 8480
Actually got: 7840
Expected to get: 2805
Actually got: 2165
Expected to get: 1971
Actually got: 7478