From: Lucas Galfaso (lgalfaso_at_[hidden])
Date: 2003-09-18 00:06:12
If such a poor algorithm is implemented, is it really that usefull the
detection of primes at compile time (and on such a small scale) that is
worth the compiler to work that hard?
"Stephen Nutt" <snutt_at_[hidden]> wrote in message
> If only prime number detection were that easy :) I do it the hard way,
> divide the suspected prime by all numbers >=2 and <= the square root of
> candidate. I skip even numbers, but found it was easier to use all odd
> numbers than to try and determine if the divisor were prime.
> So to compile is_prime<450000007> I force the compiler to do well over
> 10,000 divisions before it comes back and says "you've got a prime on your
> ----- Original Message -----
> From: "Lucas Galfaso" <lgalfaso_at_[hidden]>
> To: <boost_at_[hidden]>
> Sent: Wednesday, September 17, 2003 8:58 AM
> Subject: [boost] Re: Compile time prime numbers, powers and roots
> > how you test if a number is prime. As you might know, verifying that
> > m for a specific s, is not enough.
> > Lucas/
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk