Boost logo

Boost :

From: Stephen Nutt (snutt_at_[hidden])
Date: 2003-09-17 17:37:16


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 the
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/

Boost list run by bdawes at, gregod at, cpdaniel at, john at