Connecting Tech Pros Worldwide Help | Site Map

Huge numbers in cpp

t
Guest
 
Posts: n/a
#1: Jul 23 '05
Hello,
I am going to write a program to search for prime numbers. There will be a
lot of clients participating in this searching so I have to operate on very
huge numbers, bigger than can be stored in double...

I wonder how can I deal with this numbers? Do I have to create an array of
doubles or ints? How could I make calculations on numbers stored in such an
array?

Could you give me some ideas? Or maybe you could send me source of any
program which operates on enormous numbers stored in arrays?

Thanks in advance,
Tomek


Karl Heinz Buchegger
Guest
 
Posts: n/a
#2: Jul 23 '05

re: Huge numbers in cpp


t wrote:[color=blue]
>
> Hello,
> I am going to write a program to search for prime numbers. There will be a
> lot of clients participating in this searching so I have to operate on very
> huge numbers, bigger than can be stored in double...
>
> I wonder how can I deal with this numbers? Do I have to create an array of
> doubles or ints? How could I make calculations on numbers stored in such an
> array?
>
> Could you give me some ideas? Or maybe you could send me source of any
> program which operates on enormous numbers stored in arrays?[/color]

Why reinvent the weel.
Google is your friend. Search for 'Big number library C++ download'
and choose one.



--
Karl Heinz Buchegger
kbuchegg@gascad.at
Alf P. Steinbach
Guest
 
Posts: n/a
#3: Jul 23 '05

re: Huge numbers in cpp


* t:[color=blue]
>
> Could you give me some ideas? Or maybe you could send me source of any
> program which operates on enormous numbers stored in arrays?[/color]

<url: http://www.swox.com/gmp/>

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Alex Vinokur
Guest
 
Posts: n/a
#4: Jul 23 '05

re: Huge numbers in cpp



"t" <tkaczmarczyk@poczta.onet.pl> wrote in message news:d4qmfn$nnv$1@news.onet.pl...[color=blue]
> Hello,
> I am going to write a program to search for prime numbers. There will be a
> lot of clients participating in this searching so I have to operate on very
> huge numbers, bigger than can be stored in double...
>
> I wonder how can I deal with this numbers? Do I have to create an array of
> doubles or ints? How could I make calculations on numbers stored in such an
> array?
>
> Could you give me some ideas? Or maybe you could send me source of any
> program which operates on enormous numbers stored in arrays?
>
> Thanks in advance,
> Tomek
>
>[/color]

Try to use C++ BigInt class
https://sourceforge.net/projec*ts/cpp-bigint/
http://groups-beta.google.com/*group...e8d3ae812*abbb


--
Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn





Krzysztof Zelechowski
Guest
 
Posts: n/a
#5: Jul 23 '05

re: Huge numbers in cpp



Uzytkownik "Karl Heinz Buchegger" <kbuchegg@gascad.at> napisal w wiadomosci
news:4270DECE.5D48D20A@gascad.at...[color=blue]
>t wrote:[color=green]
>>
>> Hello,
>> I am going to write a program to search for prime numbers. There will be
>> a
>> lot of clients participating in this searching so I have to operate on
>> very
>> huge numbers, bigger than can be stored in double...
>>
>> I wonder how can I deal with this numbers? Do I have to create an array
>> of
>> doubles or ints? How could I make calculations on numbers stored in such
>> an
>> array?
>>
>> Could you give me some ideas? Or maybe you could send me source of any
>> program which operates on enormous numbers stored in arrays?[/color]
>
> Why reinvent the weel.
> Google is your friend. Search for 'Big number library C++ download'
> and choose one.
>[/color]

Search for "Search for prime numbers" and choose GIMPS.
Chris


Closed Thread