comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » !pi: Stored as a float
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
!pi: Stored as a float [message #28472] Wed, 12 December 2001 12:22
Andy Loughe is currently offline  Andy Loughe
Messages: 174
Registered: November 1995
Senior Member
Being stored as a float, the !pi system variable is accurate
to about the 6th decimal place.

IDL> print, !pi, format='(f25.23)'
3.14159274101257324218750

IDL> print, atan(1.0)*4.0, format='(f25.23)'
3.14159274101257324218750

IDL> print, size(!pi, /type) ;; 4 = Floating point
4


This would be better:

IDL> DEFSYSV, '!mypi', atan(1D)*4D, 1

IDL> print, size(!mypi, /type) ;; 5 = Double Precision
5

IDL> print, !mypi, format='(f25.23)'
3.14159265358979311599796
3.14159265358979323846264338327950288419716939937510 <- joyofpi.com

--
Andrew Loughe =====================================================
NOAA/OAR/FSL/AD R/FS5 | email: loughe@fsl.noaa.gov
325 Broadway | wwweb: www-ad.fsl.noaa.gov/users/loughe
Boulder, CO 80305-3328 | phone: 303-497-6211 fax: 303-497-6301
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Figuring out axis range?
Next Topic: Re: !pi: Stored as a float

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:07:04 PDT 2025

Total time taken to generate the page: 0.00479 seconds