Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
35
Task/Pi/Liberty-BASIC/pi.basic
Normal file
35
Task/Pi/Liberty-BASIC/pi.basic
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
ndigits = 0
|
||||
|
||||
q = 1
|
||||
r = 0
|
||||
t = q
|
||||
k = q
|
||||
n = 3
|
||||
L = n
|
||||
|
||||
first = 666 ' ANY non-zero =='true' in LB.
|
||||
|
||||
while ndigits <100
|
||||
if ( 4 *q +r -t) <( n *t) then
|
||||
print n;
|
||||
ndigits =ndigits +1
|
||||
if not( ndigits mod 40) then print: print " ";
|
||||
if first =666 then first = 0: print ".";
|
||||
nr =10 *( r -n *t)
|
||||
n =int( ( (10 *( 3 *q +r)) /t) -10 *n)
|
||||
q =q *10
|
||||
r =nr
|
||||
else
|
||||
nr =( 2 *q +r) *L
|
||||
nn =(q *( 7 *k +2) +r *L) /( t *L)
|
||||
q =q *k
|
||||
t =t *L
|
||||
L =L +2
|
||||
k =k +1
|
||||
n =int( nn)
|
||||
r =nr
|
||||
end if
|
||||
scan
|
||||
wend
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue