home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1994 January / 1994-01b.d64 / pi.pp (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  256b  |  10 lines

  1. 10 rem fast pi calculation
  2. 15 x0=sqr(2):y1=sqr(x0):p0=2+x0
  3. 20 a=sqr(x0):x=0
  4. 25 x1=(a+1/a)/2
  5. 30 a=sqr(x1):b=y1+1
  6. 35 y2=(y1*a+1/a)/b
  7. 40 p1=p0*(x1+1)/b
  8. 45 x=x+1:printx"="p1
  9. 50 x0=x1:y1=y2:p0=p1:goto25
  10.