Happy Pi Day!

Post your Gambas programming questions here.
Post Reply
User avatar
Cedron
Posts: 156
Joined: Thursday 21st February 2019 5:02pm
Location: The Mitten State
Contact:

Happy Pi Day!

Post 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...
.... and carry a big stick!
Post Reply