Huge numbers in cpp

T

t

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
 
K

Karl Heinz Buchegger

t said:
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?

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

Alex Vinokur

t said:
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

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

Krzysztof Zelechowski

Uzytkownik "Karl Heinz Buchegger said:
Why reinvent the weel.
Google is your friend. Search for 'Big number library C++ download'
and choose one.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top