for (@primes) { last if $_ > $root; # If you have checked bigger primes, +you don't want to go through all of them! print("$_ divides $num\n"), return 0 if ($num % $_ == 0); }
In reply to Re^2: a close prime number
by Roy Johnson
in thread a close prime number
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |