Share your repls and programming experiences

← Back to all posts
[PI Day2021] 14 ways for approximating PI
potatojs (843)

hi

hello there

how it works

so you have the stop and run buttons which are used to stop or continue running an algorithm

14 ways of calculating PI

these are 14 ways of calculating PI 10 infinite series which all are gorgeous, and then 4 random ways i liked the most.

why 14?

well i planned on making 31.4 ways of calculating PI but i wanna share this on PIDay and i just started yesterday so i didn't have that much time
i switched to 14 because 3.14 you know, PI day 2022 i guess?

Disclaimer

the infinite series can't go more than a certain accuracy because of float-point precision and stuff which i don't know how to fix in javascript :)
and also this isn't meant to be special or good, it's just a milestone that i'm gonna later look back at it and say
"yeah i was a damn beginner" hopefully :D

edit

lol i just remembered how broken the replit sharing place is..

Comments
hotnewtop
Whippingdot (552)

POG

Also I luv these _random ways to calculate pie

OldWizard209 (1091)

potato attaccccc
potatoo proteccc

BUT MOST IMPORTANTLY

POTATO COIME BACCCC

JeffreyChen13 (8)

This is pi based on my code: 3.141592653589788

potatojs (843)

@JeffreyChen13 yep it doesn't go more precise then that because of floating point precision and stuff which is really sad :(
i may try creating my own big float class that contains a bigint in it but i think that's gonna be really hard

JeffreyChen13 (8)

@potatojs Great! When you do, please notify me, I would definetly upvote it, and test it!

NoNameByProgram (198)

noice someday people will know irrational pi

here's what i know: 3.14159265358979323846623383279502884197169393751

potatojs (843)

@NoNameByProgram ohhh that's cool, i wish i was that smart but my potato brain can't handle that much data :D

YuvanVighnesh (108)

3.141592653589 is all I know :(

potatojs (843)

@YuvanVighnesh lol i know 3.141592653589793 :)

FlaminHotValdez (433)

@YuvanVighnesh I know 3.1415926

pi is overrated e shall rule
FlaminHotValdez (433)

@YuvanVighnesh

BE GONE NON OLYMPIAN WORSHIPPER

GO ROT IN TARTARUS

FlaminHotValdez (433)

@YuvanVighnesh

You gotta think outside the box bro

I present to you...

The ultimate negator card....

UNO SKIP!