π in Go
I think I'm pretty much doing pi approximations in every language now, so, here it is in Go!
Here are the other approximations so far:
Swift - https://repl.it/talk/share/p-in-Swift/36150
C# - https://repl.it/talk/share/p-in-C/36141
Bash - https://repl.it/talk/share/p-in-Bash/36133
Kotlin - https://repl.it/talk/share/p-in-Kotlin/36125
Ruby - https://repl.it/talk/share/p-in-Ruby/34982
Java - https://repl.it/talk/share/p-in-Java/34978
QBasic - https://repl.it/talk/share/p-in-QBasic/34973
Fortran - https://repl.it/talk/share/p-in-Fortran/34890
APL - https://repl.it/talk/share/p-in-APL/34888
Forth - https://repl.it/talk/share/p-in-Forth/34652
LOLCODE - https://repl.it/talk/share/p-in-LOLCODE/34421
Python and Node.js (Node is linked in post) - https://repl.it/talk/share/2-Approximations-of-p-In-Only-Four-Lines-of-Code/32773
C - https://repl.it/talk/share/p-Approximations-in-C/33461
Credit to @NoelBryan, @TheForArkLD , @Warhawk947 , and @LizFoster for inspiring these approximations. Most of these use the Nilakantha Series, although I also use the arctangent method (multiplying the radian arctangent of 1 by 4 to get pi and getting the arctangent with an infinite series) in three of them (Python, Node, and C).
I forgot you're still doing this, using the same algorithm over and over is boring, change it up, go do a Monte Carlo sequence in Haskell or something.
@StudentFires Well, I might do Haskell after NASM which I'm probably going to do after Rust. Also using the same algorithm is partially to test the speeds of the different languages with the same algorithm. Also, it is just easier to stick with an algorithm I know pretty well that is also efficient.
@HahaYes Sorry for the late response, but honestly, this is not about cycles and stuff. I just want to learn more programming languages and pi approximators are a good way to learn the basics of those languages. Then, of course, posting the repls gives others the opportunity to see the languages and possibly start to learn them.