 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Chris Guest
|
Posted: Fri Oct 31, 2003 4:04 am Post subject: Prime Numbers |
|
|
Hello!
I have been doing some research to see if C++ has some sort of
function to work with prime numbers.
For example, I would like to input integers and have the program check
to see if the integers are prime numbers.
I have been unsuccessful in finding anything. I am sure I can probably
figure out a long way to do it, but I was curious to see if C++ had
something available.
Thanks!
Chris
|
|
| Back to top |
|
 |
Victor Bazarov Guest
|
Posted: Fri Oct 31, 2003 4:10 am Post subject: Re: Prime Numbers |
|
|
"Chris" <del.pic (AT) verizon (DOT) net> wrote...
| Quote: | I have been doing some research to see if C++ has some sort of
function to work with prime numbers.
For example, I would like to input integers and have the program check
to see if the integers are prime numbers.
I have been unsuccessful in finding anything. I am sure I can probably
figure out a long way to do it, but I was curious to see if C++ had
something available.
|
The Standard library does NOT have such a function. If it did,
all those seekers of the largest number would have nothing to
do, would they?
Try www.google.com.
Victor
|
|
| Back to top |
|
 |
Jerry Coffin Guest
|
Posted: Fri Oct 31, 2003 5:40 am Post subject: Re: Prime Numbers |
|
|
In article <2e86a889.0310302004.bd42bfe (AT) posting (DOT) google.com>,
[email]del.pic (AT) verizon (DOT) net[/email] says...
| Quote: | Hello!
I have been doing some research to see if C++ has some sort of
function to work with prime numbers.
|
None that's particular to prime numbers, and not really much that's any
more than a building-block toward working with large numbers in general.
| Quote: | For example, I would like to input integers and have the program check
to see if the integers are prime numbers.
|
Depending on how big of numbers you want to deal with, that's anywhere
from trivial (e.g. < 20 digits) to a massive project (e.g. the General
Number Field Sieve is one of the most complex algorithms ever devised by
man).
| Quote: | I have been unsuccessful in finding anything. I am sure I can probably
figure out a long way to do it, but I was curious to see if C++ had
something available.
|
The MIRACL library has quite a nice factoring program as a free demo of
its capabilities. You can get the library (with the demo) from:
ftp://ftp.computing.dcu.ie/pub/crypto/miracl.zip
--
Later,
Jerry.
The universe is a figment of its own imagination.
|
|
| Back to top |
|
 |
Chris Theis Guest
|
Posted: Fri Oct 31, 2003 8:29 am Post subject: Re: Prime Numbers |
|
|
"Jerry Coffin" <jcoffin (AT) taeus (DOT) com> wrote
| Quote: | In article <2e86a889.0310302004.bd42bfe (AT) posting (DOT) google.com>,
[email]del.pic (AT) verizon (DOT) net[/email] says...
Hello!
I have been doing some research to see if C++ has some sort of
function to work with prime numbers.
None that's particular to prime numbers, and not really much that's any
more than a building-block toward working with large numbers in general.
For example, I would like to input integers and have the program check
to see if the integers are prime numbers.
Depending on how big of numbers you want to deal with, that's anywhere
from trivial (e.g. < 20 digits) to a massive project (e.g. the General
Number Field Sieve is one of the most complex algorithms ever devised by
man).
I have been unsuccessful in finding anything. I am sure I can probably
figure out a long way to do it, but I was curious to see if C++ had
something available.
The MIRACL library has quite a nice factoring program as a free demo of
its capabilities. You can get the library (with the demo) from:
ftp://ftp.computing.dcu.ie/pub/crypto/miracl.zip
--
Later,
Jerry.
|
Not to forget the nice "Miller Rabin probabilistic primality" test, which
IMHO is just a piece of art.
Cheers
Chris
|
|
| Back to top |
|
 |
Josephine Schafer Guest
|
Posted: Fri Oct 31, 2003 8:58 am Post subject: Re: Prime Numbers |
|
|
| Quote: |
Not to forget the nice "Miller Rabin probabilistic primality" test, which
IMHO is just a piece of art.
Yes. |
Rabin's work was based on randomized algorithms.
It shows how sometimes randomized algorithms solve problems much more easily
over their deterministic counterparts.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|