[Tutor] can python calculate the digits of pi or e?,has this been done before?,how?

Timothy Wilson wilson@visi.com
Fri, 25 Aug 2000 23:20:02 -0500 (CDT)


On Fri, 25 Aug 2000, Charles Gruschow, Jr. wrote:

> can python calculate the digits of pi or e?,has this been done before?,how?

If you're asking whether Python is capable of performing the calculations,
then sure, no problem. If you're wondering how to use those numbers in your
programs, then your can just:

Python 1.5.2 (#1, May  9 2000, 15:05:56)  [GCC 2.95.3 19991030 (prerelease)]
on linux-i386
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import math
>>> print math.pi
3.14159265359
>>> print math.e
2.71828182846
>>> 

-Tim

--
Tim Wilson      | Visit Sibley online:         | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |                              | http://slashdot.org/
wilson@visi.com |   <dtml-var pithy_quote>     | http://linux.com/