Page 1 of 1

Happy Pi Day!

Posted: Thursday 14th March 2019 4:44pm
by Cedron
Pi can be calculated using the following formulas.
        Print Atn(1) * 4
        
        Print (4 * Atn(1 / 5) - Atn(1 / 239)) * 4
Of course, you don't need to do that because Gambas has:
        Print Pi(1)   ' = Pi * 1
But, if you want super precision, there is a Taylor series for the inverse tangent, and you can use arrays for digits...