3 ms·
So don't use a lossy floating point representation and use arbitrary precision instead. Just because π is estimated to 15 significant digits doesn't mean the e
by jonhohle 11y ago
So don't use a lossy floating point representation and use arbitrary precision instead.
Just because π is estimated to 15 significant digits doesn't mean the entire calculation needs to be.
- notjpl 11y agoArbitrary precision is not a valid answer: every multiplication doubles the number of mantissa bits. Starting with a 64-bit precision, after just 40 multiplications, you will have consumed 800 GB of RAM just for storing a single number, at which point you'll ask yourself: how many decimal digits do I really need? Which was the initial question...
- WalterBright 11y agoPi cannot be stored exactly even with arbitrary precision.