[SciPy-user] Can SciPy compute ln(640320**3 + 744)/163**.5 to 30 places?

Dick Moores rdmoores at gmail.com
Mon Jan 15 01:33:03 CST 2007


On 1/14/07, Robert Kern <robert.kern at gmail.com> wrote:
> Dick Moores wrote:
> > Please show me how to do that in just plain python. I don't have or
> > know ipython.
>
> It's the same.

OK. Bryan Van de Ven's code lacked an import statement, a precision
statement, and a print statement. So I tried
=====================
# clnumTest2-a.py

import clnum as cl
cl.set_default_precision(50)
a = cl.log(640320**3 + 744)/cl.sqrt(163)

print cl.mpq(a)
=====================
And got
181338285223186289202345004581/57721768930156197489438103340
Doing that division at the python interactive prompt gets me
3.1415926535897927
hardly the precision I'm after.

Someone please show me a whole python script.

Thanks,

Dick Moores


More information about the SciPy-user mailing list