Surely on track for the *slowest* way to compute pi in Python (or any
language for that matter):

math.sqrt( sum( pow(k,-2) for k in xrange(sys.maxint,0,-1)  ) * 6.  )

Based on the Riemann zeta function:

   The sum of

        1/k^2 for k = 1:infinity

   converges to pi^2 / 6

Depending on your horsepower and the size of sys.maxint on your
machine, this may take a few *days* to run.

Note: The sum in the Python expression above runs in reverse to
minimize rounding errors.

-- 
Gerald Britton
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to