Have you already searched for "big integer c++" or "big decimal c++"?
GMP is a known library.
Out of curiosity, what do you need it for?
I have searched for something similar and I found gmp. I was just trying to find more options.
I'm working on a particle accretion simulator for fun and working with really small numbers. I'm not getting enough precision with the numbers.
Forgive me for asking, but out of curiosity, what could you possibly need more than the 19.26 decimal digits that long double gives you? Also, I don't think there is any way to store any number larger without losing precision.
edit: I guess you can ignore this post, other higher beings are more knowledgeable
I am using long double, but it is rounding numbers off. I calculate something with 13 decimals, and it is rounding off at 4 in some cases. I'm also getting read outs out equal numbers not being equal.
One such example is the gravitational constant, 0.0000000000667384. Already using up 11 decimals (I've had to truncate it to prevent getting 0 for results from rounding).
When calculating gravitational forces, you can easily get over the 19 decimals.
Fg = G * ( M1 + M2) / R ^ 2
If M1 + M2 = 1 and R ^ 2 (the squared distance between 1 and 2) is 2822400 (1680 * 1680, one side of my screen to the other).
Fg = G * 1 / 2,822,400 = 0.000000000000000023645975 ( 24 decimals )