Q:

Many decimal places required in python calculations

I need to accurately sum up a long list of decimal numbers with a precision of at least 50 decimal places. I also need to be able to print some sums. What I really need is unlimited decimal places.
I have no good idea about how to do this. Floating numbers are supposed to be converted to strings and then printed out with the Decimal module right? But I have no success in understanding the module or its limitations. If someone could help me with this problem and/or maybe hint me of some instructive article about the decimal module or floating point numbers in python, it would really help me and others.
My attempt was:
from __future__ import division
from decimal import *
getcontext().prec = 160

summan = 0
lista = [1/4,1/3,1/5,1/6,1/7,1/9,1/10,1/11]

for x in lista:
    summan += x
    print Decimal(str(summan))

A:

Have a look at the documentation... for fraction divisions with high precision you can do something like:
from decimal import *
getcontext().prec = 160

summan = 0
lista = ['1/4','1/3','1/5','1/6','1/7','1/9','1/10','1/11']

for x in lista:
    den, num = x.split('/')
    print Decimal(den) / Decimal(num)

