To celebrate pi day with my school I created a function to compute an approximation for pi. It seems R has a maximum digit preference of 16 digits by default. Here is my code:
I used the format command to control how many digits were produced by the approximation, but the maximum output seems to be 16. I used the following command to run the program and find the first 16 correct digits of pi.
This computation took miliseconds to compute in R. It took mathematicians without computer capabilities years to compute this approximation accurately. I wonder if there is some way to make R compute this more precisely?