comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Pi is Rotten?
items: Re: Pi is Rotten?

Pi is Rotten?
type: item
description: Folks, Perhaps because today is Pi Day: http://bit.ly/1lDkQi4 Andrew Cools alerts me to an IDL problem of utmost importance. I refer, of course, to an inexplicable problem with IDL's version of Pi: IDL> print, !dpi, format='(f0.18)' 3.1415926535897931 As everyone knows, the actual value of Pi is 3.1415926535897932. The last digit here is a "2", not a "1". http://bit.ly/1qCvycp Even ExelisVis itself realizes this, and puts the proper value in the new !Const system variable. What's up with this? Can we ever trust IDL again? Cheers, David P.S. Let's just say I'm off to get a piece of apple with my morning Joe. -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thue. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2014-03-14T13:17:51-00:00

Re: Pi is Rotten?
type: item
description: David Fanning <news@idlcoyote.com> wrote: > Folks, > > Perhaps because today is Pi Day: > > http://bit.ly/1lDkQi4 > > Andrew Cools alerts me to an IDL problem of utmost importance. I refer, > of course, to an inexplicable problem with IDL's version of Pi: > > IDL> print, !dpi, format='(f0.18)' > 3.1415926535897931 Hm, !dpi is a double precision number. It has about 16 useful digits. Due to rounding the last digit is always uncertain. Norbert
creator: Norbert Hahn
date: 2014-03-14T16:08:11-00:00

Re: Pi is Rotten?
type: item
description: Norbert Hahn writes: > David Fanning <news@idlcoyote.com> wrote: > >> Folks, >> >> Perhaps because today is Pi Day: >> >> http://bit.ly/1lDkQi4 >> >> Andrew Cools alerts me to an IDL problem of utmost importance. I refer, >> of course, to an inexplicable problem with IDL's version of Pi: >> >> IDL> print, !dpi, format='(f0.18)' >> 3.1415926535897931 > > Hm, !dpi is a double precision number. It has about 16 useful digits. > Due to rounding the last digit is always uncertain. That's what I told him. He is not satisfied. :-( Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thue. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2014-03-14T16:16:55-00:00

Re: Pi is Rotten?
type: item
description: In case anyone might think the sky is actually falling, at least with IDL 8.2.3 Windows 7 64-bit: IDL> print,!dpi,format='(F25.23)' 3.14159265358979310000000 IDL> print,!const.pi,format='(F25.23)' 3.14159265358979310000000 And I think this can reassure us that at that digit position, double precision does not distinguish between those two values: IDL> print,3.1415926535897932D EQ 3.1415926535897931D 1 Further: IDL> print,3.1415926535897928D EQ 3.1415926535897931D 0 IDL> print,3.1415926535897929D EQ 3.1415926535897931D 1 IDL> print,3.1415926535897930D EQ 3.1415926535897931D 1 IDL> print,3.1415926535897931D EQ 3.1415926535897931D 1 IDL> print,3.1415926535897932D EQ 3.1415926535897931D 1 IDL> print,3.1415926535897933D EQ 3.1415926535897931D 1 IDL> print,3.1415926535897934D EQ 3.1415926535897931D 0 https://www.idlcoyote.com/math_tips/sky_is_falling.html Cheers, -Dick Dick Jackson Software Consulting Inc. Victoria, BC, Canada www.d-jackson.com On Friday, March 14, 2014 6:17:51 AM UTC-7, David Fanning wrote: > Folks, > > Perhaps because today is Pi Day: > > http://bit.ly/1lDkQi4 > > Andrew Cools alerts me to an IDL problem of utmost importance. I refer, > of course, to an inexplicable problem with IDL's version of Pi: > > IDL> print, !dpi, format='(f0.18)' > 3.1415926535897931 > > As everyone knows, the actual value of Pi is 3.1415926535897932. The > last digit here is a "2", not a "1". > > http://bit.ly/1qCvycp > > Even ExelisVis itself realizes this, and puts the proper value in the > new !Const system variable. What's up with this? Can we ever trust IDL > again? > > Cheers, > David > > P.S. Let's just say I'm off to get a piece of apple with my morning Joe. > > -- > David Fanning, Ph.D. > Fanning Software Consulting, Inc. > Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ > Sepore ma de ni thue. ("Perhaps thou speakest truth.")
creator: Dick Jackson
date: 2014-03-14T18:30:10-00:00

Re: Pi is Rotten?
type: item
description: On Friday, March 14, 2014 7:17:51 AM UTC-6, David Fanning wrote: > Folks, > > > > Perhaps because today is Pi Day: > > > > http://bit.ly/1lDkQi4 > > > > Andrew Cools alerts me to an IDL problem of utmost importance. I refer, > > of course, to an inexplicable problem with IDL's version of Pi: > > > > IDL> print, !dpi, format='(f0.18)' > > 3.1415926535897931 > > > > As everyone knows, the actual value of Pi is 3.1415926535897932. The > > last digit here is a "2", not a "1". > > > > http://bit.ly/1qCvycp > > > > Even ExelisVis itself realizes this, and puts the proper value in the > > new !Const system variable. What's up with this? Can we ever trust IDL > > again? > > > > Cheers, > > > > David > > > > P.S. Let's just say I'm off to get a piece of apple with my morning Joe. > > > > -- > > David Fanning, Ph.D. > > Fanning Software Consulting, Inc. > > Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ > > Sepore ma de ni thue. ("Perhaps thou speakest truth.") David, You might consider updating your Sky is Falling article to include a discussion on the new "implied print" behavior of IDL 8.3. "For floating-point data types, unlike the PRINT procedure, Implied Print will automatically use the maximum number of digits of precision." Will it prevent angry phone calls from researchers at 3 am? Probably not. Jim P.
creator: Jim Pendleton
date: 2014-03-16T20:10:45-00:00