So after a few months of slashing my way through the JavaScript Jungle, I've landed myself in a clearing.
A perfectly circular clearing.
And to calculate its diameter, I'm going to need pi. And an arbitrarily large number of digits after the decimal point (although you only really need 31 digits at most), too.
I found out this program while searching the web:
let i = 1n; let x = 3n * (10n ** 1020n ); let pi = x; while (x>0) { x = x * 1 / ((i + 1n) * 4n); pi += x / (i + 2n); i += 2n; } console.log(pi / (10n ** 20n));
and it's able to calculate 1000 digits of pi.
I have it here roughly "translated" into TI-BASIC (although slightly modified so as to not have a huge number show up):
:ClrHome
:1→I
:3→X
:X→P
:Output(1,1,"∏=
:While > 0
:X*I/((I+1)*4)→X
:P+X/(I+2)→P
:I+2→I
:Output(1,3,P
:Output(2,1,10^(12)(P-3.14159265
:End
(Of course, since the Output( commands are inside the For( loop, it will output the current value of P (the pi counter) while it's being calculated.)
However, due to the nonspecific nature of the TI-83 Plus TI-BASIC system I'm using, it won't output an approximation of pi that's more accurate than what's already on hand using the ∏ button.
If any of you out there know a possible work-around to the decimal problem, I would be most grateful.
Thanks in advance,
Mathsman502
(M→02)