Arithmetic-geometric mean/Calculate Pi: Difference between revisions
Arithmetic-geometric mean/Calculate Pi (view source)
Revision as of 07:28, 22 October 2022
, 1 year ago→{{header|Raku}}: mention task Integer roots
m (→{{header|Pascal}}: cosmetic) |
(→{{header|Raku}}: mention task Integer roots) |
||
Line 1,395:
} = \frac{\sqrt{n 10^{2N} / d}}{10^N}</math>
so that what we need is one square root of a big number that we'll truncate to its integer part. We'll
Notice that we don't get the exact number of decimals required : the last two decimals or so can be wrong. This is because we don't need <math>a_n</math>, but rather <math>a_n^2</math>. Elevating to the square makes us lose a bit of precision. It could be compensated by choosing a slightly higher value of N (in a way that could be precisely calculated), but that would probably be overkill.
|