in reply to YAPNC: Yet another prime number checker?
It's of course a lot more efficient to decide a number is prime as soon as you have found a divisor > 1 and smaller or equal to sqrt (number). No need to do millions of divisions to decide 100000000 is prime after finding out it's divisible by 2.
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: YAPNC: Yet another prime number checker?
by Abigail-II (Bishop) on Oct 09, 2002 at 14:45 UTC |