Are there any variables in C++ that can handle BIG numbers?

Crescent13

Diamond Member
Jan 12, 2005
4,793
1
0
I want to make a code with the first 10,000 digits of pi, but whenever I try to compile it, it gives me all sorts of errors. I've tried double, long, and int, and it is too long for any of them. does anyone know of some vairables that will hold big numbers?

EDIT: This is NOT a homework assignment, I want to make a program to push a CPU to its limits, and I am doing this of my own free will.
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
http://www.swox.com/gmp/gmpbench.html

There's also a GMPBench for benchmarking extremely large numbers, if you wondered.

You could also make your own custom structure to store it (sort of like a string). I don't think you could perform any operations on it though.

You could do some sloppy hack code to get it to work too. Infact this may be how GMP works but by no means am I sure.

For example: 46000000000000000000000000000000000*1000=
46*1=46
count number of zeros, add that many zeros to the string. your answer is stored in the string. I take it you are trying to stress the FPU or the ALU?

What is your pi stored in? Floating-point I assume?

Check this out too.
http://www.files32.com/info21447.htm

Inline assembly to work with 128-bit integers, in Delphi:

http://64.233.167.104/search?q=cache:7n...s/article_3772.asp+huge+integers&hl=en