Is there any data structure available

Nov 23, 2012 at 11:01am
1. For storing more than 6 decimal places after the decimal point?

2. For storing a number having more than 10^3 digits?
Nov 23, 2012 at 1:32pm
http://www.cplusplus.com/doc/tutorial/variables/

scroll down till "Fundamental data types"
Last edited on Nov 23, 2012 at 1:33pm
Nov 24, 2012 at 1:08pm
Lol. Better you'd read my question correctly :P
Nov 24, 2012 at 1:14pm
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/
Nov 24, 2012 at 1:24pm
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.