Metropoli BBS
VIEWER: pi.txt MODE: TEXT (ASCII)
a # 1 60 R ' sum#pi n;i;term;rem                                        '
a # a,[1]  ' sum#term#0,(n+i#1)Y3                                       '
a # a,[1]  'loop:term#(term mul i)div 4Xi+1                             '
a # a,[1]  ' sum#sum add term div i#i+2                                 '
a # a,[1]  ' $(V/term^=0)/loop                                          '
a # a,[1]  ' sum#(_n),1Usum                                             '
a # a,[1]  ' $0                                                         '
a # a,[1]  '"pi - compute pi to arbitrary precision                     '
a # a,[1]  '"from ''the apl handbook of techniques'' copyright 1978, ibm. '
a # a,[1]  '"-compute pi (3.14159+) to 7Xn decimal digits of precision  '
a # a,[1]  '"-the arcsin power series (6X-1O.5) is summed--not the      '
a # a,[1]  '" fastest known method, but far from the slowest            '
a # a,[1]  '"-running time is proportional to n*2                       '
a # a,[1]  '"-uses: Gadd Gmul Gdiv                                      '
Lfx a
[ RETURN TO DIRECTORY ]