I have a problem, I am trying to calculate what the lowest prime is of a number but I do not understand the result that PHP is giving me.
If I have this number
Using PHP 5.2.8, it fails as described in the question. It seems like the modulo operator doesn't work on big integers. You should consider using bc_mod (modulus with arbitrary precision):
$value)
{
if($number % $value == 0 ) {echo $value."
"; }
if(bcmod($number, $value) == 0) {echo "bcmod ".$value."
"; }
}
?>
The above code prints:
3
29
bcmod 71