next if ( $last_digit == 5 or $last_digit = 0 );
did you mean:
next if ( $last_digit == 5 or $last_digit == 0 );
also to make it run even faster you might want to look to have it only check from $input to sqrt($input). If it does not fail up to the
sqrt($input) it will not fail past that point.
-Enlil
In reply to Re: YAPNC: Yet another prime number checker?
by Enlil
in thread YAPNC: Yet another prime number checker?
by snafu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |