Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/Pi/Icon/pi.icon
Normal file
28
Task/Pi/Icon/pi.icon
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
procedure pi (q, r, t, k, n, l)
|
||||
first := "yes"
|
||||
repeat { # infinite loop
|
||||
if (4*q+r-t < n*t) then {
|
||||
suspend n
|
||||
if (\first) := &null then suspend "."
|
||||
# compute and update variables for next cycle
|
||||
nr := 10*(r-n*t)
|
||||
n := ((10*(3*q+r)) / t) - 10*n
|
||||
q *:= 10
|
||||
r := nr
|
||||
} else {
|
||||
# compute and update variables for next cycle
|
||||
nr := (2*q+r)*l
|
||||
nn := (q*(7*k+2)+r*l) / (t*l)
|
||||
q *:= k
|
||||
t *:= l
|
||||
l +:= 2
|
||||
k +:= 1
|
||||
n := nn
|
||||
r := nr
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
procedure main ()
|
||||
every (writes (pi (1,0,1,1,3,3)))
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue