pycharm - Increase Accuracy of float division (python) -


i'm writing bit of code in pycharm, , want division more accurate (40-50 numbers instead of 15). how can accomplish this?

thanks.

check out decimal module:

>>> decimal import * >>> getcontext().prec = 50 >>> decimal(1)/decimal(7) decimal('0.14285714285714285714285714285714285714285714285714') 

if you're interested in more sophisticated operations decimal provides, can @ libraries bigfloat, or mpmath (which use, , lot.)


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -