about presicion

Ali alikakakhel3 at hotmail.com
Sat Aug 28 17:03:59 EDT 2004


"Batista, Facundo" <FBatista at uniFON.com.ar> wrote in message news:<mailman.2518.1093611862.5135.python-list at python.org>...
> [alikakakhel3 at hotmail.com]
> 
> 
> #- I was wondering if it was posible to get very good presicion. I mean
> #- like to the to the 100 th or more decimal place. if so how?
> 
> In Python 2.4 you'll have the Decimal module:
> 
> 
> Python 2.4a2 (#55, Aug  5 2004, 11:42:43) [MSC v.1310 32 bit (Intel)] on
> win32
> ...
> >>> import decimal
> >>> decimal.getcontext().prec=100
> >>> d = decimal.Decimal(2)
> >>> d.sqrt()
> Decimal("1.41421356237309504880168872420969807856967187537694807317667973799
> 0732478462107038850387534327641573")
> 
> Enjoy it.
> 
> .	Facundo

The decimal module comes with python 2.4? I have 2.3, :(, what do I do?



More information about the Python-list mailing list