Dick Moores wrote: > I'm having trouble getting my mind around the decimal module. From > the tutorial (<http://docs.python.org/lib/decimal-tutorial.html>) I > can see how to get 1/7 to, say, 32 places: > > >>> from decimal import Decimal > >>> getcontext().prec = 32 > >>> Decimal(1) / Decimal(7) > Decimal("0.14285714285714285714285714285714") > > But I can't figure out how to compute to 32 places things like the > square root of 2, or the arc tangent of .41. Could someone please show me? > > I think square root calculations, and other math operations, by the built-in math.py package only work on floats since they wrap math.c So you'd have to find a pure-python implementation that supported Decimal objects I guess, or write your own. > Thanks, > > Dick Moores > [EMAIL PROTECTED] > > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > >
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor