Is there any data structure available

1. For storing more than 6 decimal places after the decimal point?

2. For storing a number having more than 10^3 digits?
http://www.cplusplus.com/doc/tutorial/variables/

scroll down till "Fundamental data types"
Last edited on
Lol. Better you'd read my question correctly :P
1. double/long double. How many places they can store after the decimal point mainly depends on how many places there are before the decimal point.

2. The types provided by GMP: http://gmplib.org/
Number one is covered by double or long double.

Number two: You could try the boost library which will do up to 300 sf, but I must ask why you want to do that?

If it is something along the lines of working out PI to 1000 digits say, then you need a different method to do this rather than a variable type.

Here is a link that show various methods of calculating pi, with varying levels of difficulty.

http://beej.us/blog/data/pi-chudnovsky-gmp/


I am guessing why you need this - maybe you can see how it works and adapt it for your needs.

Good luck.
Topic archived. No new replies allowed.