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

Scott Ransom sransom at nrao.edu
Sat Jan 13 13:05:55 CST 2007


On Sat, Jan 13, 2007 at 10:59:51AM -0800, Dick Moores wrote:
> On 1/13/07, Darren Dale <dd55 at cornell.edu> wrote:
> > On Saturday 13 January 2007 9:39 am, Dick Moores wrote:
> > > Can python compute ln(640320**3 + 744)/163**.5 to 30 places?
> >
> > It looks like it is good to about 16 digits:
> >
> > >>> '%1.32f'%(log(640320**3 + 744)/163**.5)
> > '3.14159265358979311599796346854419'
> >
> > '3.14159265358979323846264338327950'
> > 1.234567890123456^
> 
> Is that SciPy at work? If so, it's no better than plain old Python:
> 
> >>> from math import log as ln
> >>> ln(640320**3 + 744)/163**.5
> 3.1415926535897931
> 
> But thanks,
> 
> Dick

That is correct.  Scipy does not have builtin arbitrary precision
capabilities.  However, you should be able to find the old
"real.py" module around on the net.  With that you get:

In [1]: from real import *
<<  Ignoring a DeprecationWarning about the regex module here >>

In [4]: log(640320**3 + 744)/sqrt(163)
Out[4]: 3.1415926535897932384626433832797+-4

In [5]: log(640320**3 + 744)/sqrt(163) / pi()
Out[5]: 1.000000000000000000000000000000+-1

Scott

-- 
Scott M. Ransom            Address:  NRAO
Phone:  (434) 296-0320               520 Edgemont Rd.
email:  sransom at nrao.edu             Charlottesville, VA 22903 USA
GPG Fingerprint: 06A9 9553 78BE 16DB 407B  FFCA 9BFA B6FF FFD3 2989


More information about the SciPy-user mailing list