in reply to
Re: Re: Prime Number Finder
in thread Prime Number Finder
nope! they all look prime to me!
i like it, i'm gonna use it to explain programming loops to a mathmatician friend. i took the liberty to re-arrange a touch...
my $number = shift;
my $sqrt = sqrt $number;
my $d = 2;
return 0 if ( $number % $d == 0 );
return 1 if ( $d > $sqrt );
I have absolutely zero preference
Results (14 votes),