
Create a program to continually calculate and output the next decimal digit of   



π


{\displaystyle \pi }

   (pi).

The program should continue forever (until it is aborted by the user) calculating and outputting each decimal digit in succession.

The output should be a decimal sequence beginning   3.14159265 ...



Note: this task is about   calculating   pi.   For information on built-in pi constants see Real constants and functions.



Related Task Arithmetic-geometric mean/Calculate Pi

  [ immovable
    ]this[ share ]done[ ] is value     (   --> x )
 
  [ ]'[ replace ]         is to        ( x -->   )
 
  [ value 1 ]             is Q         (   --> x )
  [ value 0 ]             is R         (   --> x )
  [ value 1 ]             is T         (   --> x )
  [ value 1 ]             is K         (   --> x )
  [ value 3 ]             is N         (   --> x )
  [ value 3 ]             is L         (   --> x )
 
  [ value 0 ]             is chcount   (   --> x )
 
  [ echo 
    chcount dup 79 = 
    if cr
    1+ 80 mod to chcount ] is printch
 
  [ 4 Q *  R  + T - N T * < iff
      [ N printch
        R N T * - 10 *
        3 Q * R + 10 * T / N 10 * - to N to R
        Q 10 * to Q ]
    else
      [ 2 Q  * R + L * 
        7 K * Q * 2 + R L * + T L * / to N to R
        K Q * to Q
        T L * to T
        L 2 + to L
        K 1+  to K ]
    chcount again ]