Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/Pi/Nanoquery/pi.nanoquery
Normal file
28
Task/Pi/Nanoquery/pi.nanoquery
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
q = 1; r = 0; t = 1
|
||||
k = 1; n = 3; l = 3
|
||||
|
||||
nn = null; nr = null
|
||||
first = true
|
||||
|
||||
while true
|
||||
if (((4 * q) + r) - t) < (n * t)
|
||||
print n
|
||||
if first
|
||||
print "."
|
||||
first = false
|
||||
end
|
||||
nr = int(10 * (r - (n * t)))
|
||||
n = int((10 * ((3 * q) + r)) / t) - (10 * n)
|
||||
q *= 10
|
||||
r = nr
|
||||
else
|
||||
nr = int(((2 * q) + r) * l)
|
||||
nn = int((((q * (7 * k)) + 2) + (r * l)) / (t * l))
|
||||
q *= k
|
||||
t *= l
|
||||
l += 2
|
||||
k += 1
|
||||
n = nn
|
||||
r = nr
|
||||
end if
|
||||
end while
|
||||
Loading…
Add table
Add a link
Reference in a new issue