Created
December 12, 2017 01:47
-
-
Save benrob0329/fa720f235833bd498db4784da6d1ba9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local calpi = function() | |
local operator = '+' | |
local mypi = 0 | |
for i=1, 1000000000, 2 do | |
if operator == '+' then | |
mypi = mypi + (4/i) | |
operator = '-' | |
elseif operator == '-' then | |
mypi = mypi - (4/i) | |
operator = '+' | |
end | |
end | |
print(mypi) | |
end | |
calpi() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment