Share your repls and programming experiences

← Back to all posts
π in Elixir
AmazingMech2418 (1102)

I think I'm pretty much doing pi approximations in every language now, so, here it is in Elixir!

The issue with NASM has been fixed, but I still need to figure out float addition, subtraction, multiplication, and division before the NASM approximation will be ready.

Here are the other approximations so far:
Julia -
Nim -
Crystal -
F# -
Lua -
Dart -
R -
Haskell -
Raku -
Rust -
Go -
Swift -
C# -
Bash -
Kotlin -
Ruby -
Java -
QBasic -
Fortran -
Forth -
Python and Node.js (Node is linked in post) -
C -

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'm not really sure which one is next up. LOL! (I'm still working on NASM, but can't really tell when I'll be able to get that one done.) If you have any suggestions for after those, please let me know! I would prefer to save Lisp dialects for a little later. Some examples for ideas for the next ones are like Erlang, Quil, etc.

Also, credit to @awesome10 for suggesting Elixir!

By the way, I'm starting to run out of languages, so please suggest any you would like to see me do. After Erlang, there will be no official languages left other than Lisp dialects and esolangs, but there are some other languages (like OCaml, Quil, etc.) that can be found using the method in my tutorial at Though, I am saving Lisp dialects (including Scheme, Clojure, etc.) and esolangs for last (or close to last). After I finish the approximations using the Nilakantha Series, I will go through all of the languages again and do another algorithm (I'm thinking either trapezoidal sums or Monte Carlo). I will also then make a tutorial on transpiling programming languages.

AmazingMech2418 (1102)

@TheForArkLD It's afternoon where I am. LOL!

TheForArkLD (770)

@AmazingMech2418 i make forever / for / while loop in stacklangsharp( sls )

AmazingMech2418 (1102)

@Warhawk947 Thank you! Any suggestions for the next one?

AmazingMech2418 (1102)

@Warhawk947 LOL! I said I'm saving esolangs for last though.

AmazingMech2418 (1102)

@Warhawk947 So, do you have any non-esolang suggestions?

AmazingMech2418 (1102)

@Warhawk947 I'm not planning on doing C++ since I've already done it in C.

awesome10 (233)

hooray! i was mentioned!!!!

firefish (953)

Try pi in VLang? (my made up language)
TRy the unfinished API that's TOTALLY NOT STOLEN CODE