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

Scott Ransom sransom at nrao.edu
Sat Jan 13 14:22:47 CST 2007


On Sat, Jan 13, 2007 at 03:02:42PM -0500, Tommy Grav wrote:
> Actually if you use floats instead of int is the expression you get
> 
>  >>> print '%1.32f' % (log(640320.**3. + 744.)/163.**.5)
> 3.14159265358979311599796346854419
>  >>> print '%1.32f' % (pi)
> 3.14159265358979311599796346854419
>  >>>

Too bad neither of those is close to the real value of the OP's
relation or the real value of Pi:
  3.141592653589793238462643383279502884197169....

You can't do better than 15-16 decimal points of precision with
"normal" double-precision floating point math (which is what
python and numpy use).

S

-- 
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