Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] c++... a bit OT


On Wed, 15 Nov 2000 alex060@xxxxxxxxxxxxxxxx wrote:

> hi all
> i took the commen advice and i am teaching myself c++ ;-)

This is quite off topic ... but ...

> i have played with a few things and am going well but im stumped with a
> problem..
> 
> i decided to make a prime number generator. I started with
> plain brute force trying every combo and it all worked well.

try a search on google for "the sieve of erastothenes" or somtehing
like that ... it is the classic algorithm for finding primes.
brute force will get you nowhere ;^)

why C++ would help you with a problem like this is beyond me :)

O-O integer perhaps? if (number(9).isprime()) { dothis();) } ???


--
Rick Welykochy || Praxis Services
"Tired of being a crash test dummy for Microsoft? Try Linux"