when we change the code that way the programme gets awful slow when I want to calculate say 100 digits or more .Can't we just get the numbers out of there without changing the code radically thus not making the programme sloww?
Do you Yahoo!?
Yahoo! Search presents - Jib Jab's 'Second Term'--
h
Title: RE: on the way to find pi!
[Fredrik Lundh]
#- what's the point of that? the math module already contains
#- pi with as many
#- decimals as you can put in a Python float:
#-
#- $ python
#- >>> pi = 3.1415926535897932384
#- >>> pi
#-
Ali Polatel wrote:
> write the code type str(pi(5)) and see what I mean
it helps if you post the code you want help with in your first post,
so people don't have to guess.
the pi function doesn't return anything, it prints the value to stdout
(that's what the stdout.write things are doing).
if
write the code type str(pi(5)) and see what I mean__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --
http://mail.python.org/mailman/listinfo/python-list
that's just little near to pi... pi is so far away ;)__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --
http://mail.python.org/mailman/listinfo/python-list
Ali Polatel wrote:
> I found a code which calculates pi with an interesting algorithm the
> programme code is below:
> [code snipped]
> This code gives the number in an unusual format like "3.1415'None'" it has
> a number part and a string part.
are you sure?
$ python pi.py
How many d
Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> math.pi
3.1415926535897931
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list