about presicion

Batista, Facundo FBatista at uniFON.com.ar
Fri Aug 27 09:00:06 EDT 2004


[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



More information about the Python-list mailing list