Pi is calculating wrong
So ive been more into pi and formulas and all that. I thought pi was cool, so I looked up how to calculate it in Python. I used multiple formulas, but it took forever. Then I stumbled upon the Chudnovsky formula. I looked it up, and pasted the whole formula into Pycharm. It didn’t work it printed 163096908.00. What? Not even close! I looked on Wikipedia and they had a Python script! copied it and, it did work but it printed in and array. Please help! I Can’t figure it out and AI keeps telling me the same thing! Here’s the code:
Why isn’t my function giving the desired number of decimal digits for PI?
I have been trying to make a function that calculates pi to n digits using the Leibniz’ formula. I am using the decimal module to be able to set how many decimal points I wish to output, but for some reason I always get the same number of points.