asfor($i=$o; $i<=$e; $i++){
That way you start on an odd number and account for the only even number which is prime. There is no need to check even numbers after 2.print "2 is prime\n" if $o == 2; $o++ if $o % 2; for my $i ( $i=$o; $i<=$e; $i+=2 ){
In reply to (ichimunki) Re: Prime Number Finder
by ichimunki
in thread Prime Number Finder
by munchie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |