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

Dick Moores rdm at rcblue.com
Mon Jan 15 10:52:46 CST 2007


That's great! Thanks!

Now, how about something such as (5/23)**(2/7)?
print repr(n.exp(n.log(5/23)*2/7))
gets ValueError: log domain error

Dick

At 06:45 AM 1/15/2007, you wrote:

>Hi,
>
>You should really ask the clnum guy, but I think you need to use exp()
>and log() instead of pow().  Also, you have to use only integers.
>
>pow(x,y) = exp(log(x)*y)
>
>In your case...
>
>from clnum import *
>set_default_precision(50)
>exp(log(2)*39/10)
>
>which gives:
>
>mpf('14.92852786458891865570149225839907467243567942962390462241',55)
>
>-Frank
>
>
>Dick Moores wrote:
> > I hope I may ask another question. I'd like to know how use clnum to
> > calculate 2**3.9 to a precision of 40. I looked carefully at
> > http://calcrpnpy.sourceforge.net/clnumManual.html and tried various
> > things, but to no avail.
> >
> > Despite these words in the manual:
> >
> > "Most of the functions in the clnum module are arbitrary precision
> > floating point versions of Python builtins. See the Python
> > documentation in the math, cmath, and builtins sections for the
> > following functions: acos, acosh, asin, asinh, atan, atan2, atanh,
> > ceil, cos, cosh, degrees, exp, floor, hypot, log, log10, radians,
> > round, sin, sinh, sqrt, tan, and tanh."
> >
> > it seems there is no clnum.pow(). Help, please.
> >
> > Thanks,
> >
> > Dick Moores
> > _______________________________________________
> > SciPy-user mailing list
> > SciPy-user at scipy.org
> > http://projects.scipy.org/mailman/listinfo/scipy-user
> >
>
>_______________________________________________
>SciPy-user mailing list
>SciPy-user at scipy.org
>http://projects.scipy.org/mailman/listinfo/scipy-user




More information about the SciPy-user mailing list