ScratchData LogoScratchData
Back to 52525rr's profile

Pi calculator 2022

5252525rr•Created July 29, 2021
Pi calculator 2022
327
279
9296 views
View on Scratch

Description

this uses a spigot algorithm to compute 100,000* digits of pi, using entire lists to represent numbers so the program doesn't run out of precision. running the function will spit out another digit no matter what the procedure is a=1; b=180; c=60; z=1; pi=[] repeat 100000: z = z+1 x = a*(9*z-4) x = x*3 + b*5 digit = floor(x/(5*c)) x = (b - digit * c) + (a * (5*z - 2)) x = x*30 x = x*(z*3 + 1) b = x*(z*3 + 2) x = a*z*10 a = x*(z*2 - 1) x = c*3 x = x*(z*3+1) c = x*(z*3+2) pi.append(digit) * this can technically do more digits but I haven't found the breaking point yet

Project Details

Project ID556618422
CreatedJuly 29, 2021
Last ModifiedMarch 31, 2022
SharedMarch 17, 2022
Visibilityvisible
CommentsAllowed