Happy Pi Day!

Post

Posted
Rating:
#1 (In Topic #242)
Avatar
Regular
Cedron is in the usergroup ‘Regular’
Pi can be calculated using the following formulas.

Code (gambas)

  1.         Print Atn(1) * 4
  2.        
  3.         Print (4 * Atn(1 / 5) - Atn(1 / 239)) * 4
  4.  

Of course, you don't need to do that because Gambas has:

Code (gambas)

  1.         Print Pi(1)   ' = Pi * 1
  2.  

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!
Online now: No Back to the top
1 guest and 0 members have just viewed this.