Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Re: Prime Number Finder

by LanceDeeply (Chaplain)
on Jul 17, 2002 at 19:58 UTC ( #182564=note: print w/replies, xml ) Need Help??


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...
sub isPrime { my $number = shift; my $sqrt = sqrt $number; my $d = 2; while (1) { return 0 if ( $number % $d == 0 ); return 1 if ( $d > $sqrt ); $d++; } }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://182564]
help
Chatterbox?
[shmem]: I disagree
[LanX]: sure you are German
[shmem]: germans do have humour. Open debate is what germans, and what humour. There. :-)
[LanX]: :-P

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2017-04-27 19:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (513 votes). Check out past polls.