laziness, impatience, and hubris | |
PerlMonks |
Re: YAPNC: Yet another prime number checker?by Enlil (Parson) |
on Oct 08, 2002 at 22:26 UTC ( [id://203782]=note: print w/replies, xml ) | Need Help?? |
I have a couple of questions regarding what you are doing. On the following line: 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 -Enlil
In Section
Seekers of Perl Wisdom
|
|