π in Ruby
AmazingMech2418 (1016)

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

Here are the other approximations so far:
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 @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).

You are viewing a single comment. View All
AmazingMech2418 (1016)

Next, should I do Rust or Go? I'd have to learn both to do them, so I just want to know which to start with.

Jakman (473)

@AmazingMech2418 would be cool if done in F# by .NET Microsoft
would be nice to see other F# projects since i plan on learning all .NET languages.

AmazingMech2418 (1016)

@Jakman I'm currently thinking about doing it in as many languages as possible, so maybe F# some time in the future?

Jakman (473)

@AmazingMech2418 cool the syntax is slightly weird. The language is meant to break security after all. But i think one with your expertise would enjoy it.

AmazingMech2418 (1016)

@Jakman If you think F# is weird, try APL!

Jakman (473)

@AmazingMech2418 i will do that in the next 10 minutes. Thank you for the suggestion.

AmazingMech2418 (1016)

@Jakman Do you know what type of Assembly Repl.it supports? I copied and pasted a "Hello world" program to start learning it and it didn't work.

Jakman (473)

@AmazingMech2418 I dont know. You may want to ask a mod abt that. It might even run on C. idk

AmazingMech2418 (1016)

@Jakman I tried x86 and it said there was a format error.

Jakman (473)

@AmazingMech2418 i dont know what to tell you man. Ask for it in the Ask column. Someone on this site will answer.

Jakman (473)

@AmazingMech2418 good this will bring attension to the matter.

AmazingMech2418 (1016)

@Jakman Can you comment or upvote to get it on the top of the list? My C pi approximations actually ended up never getting an upvote... I don't want that to be the fate of the ask post since then, people wouldn't answer.

Jakman (473)

@AmazingMech2418 yes. I will also make a bot to upvote it possibly.

theangryepicbanana (1689)

@AmazingMech2418 @Jakman While F# is awesome, upvote botting is not. Please do not discuss anything related to botting or you will both be banned from using Repl Talk. We take this stuff seriously so please take this as a warning and don't go further :)