which pi formula is given in the decimal module documentation?

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Tue Dec 22 01:03:40 EST 2009


On Tue, 22 Dec 2009 04:04:56 +0000, Albert van der Horst wrote:

> In article <00b967e1$0$15623$c3e8da3 at news.astraweb.com>, Steven D'Aprano
>  <steve at REMOVE-THIS-cybersource.com.au> wrote:
>>Nice work! But I have a question...
>>
>>On Mon, 21 Dec 2009 20:40:40 +0000, Albert van der Horst wrote:
>>
>>> def pi4():
>>>     ' Calculate pi by a 5th order process, with favorable stop
>>>     criterion'
>>>     precision = 10e-20
>>
>>
>>Why do you say 10e-20 instead of 1e-19?
> 
> No thought went into that.
> Note that the error jumps from 1e-5 to 1e-25 between iterations, so
> 1e-20 or 1e-19 hardly makes a difference.

Ah, then it's a typo -- you've written TEN e-20 instead of ONE e-20 in 
your code. 


-- 
Steven



More information about the Python-list mailing list