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

Home » Public Forums » archive » Re: Looking for someone who contacted me a while back.
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
Re: Looking for someone who contacted me a while back. [message #17725] Mon, 08 November 1999 00:00
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
davidf@dfanning.com (David Fanning) writes:

> P.S. Have you guys ever read Alice in Wonderland? You
> would like it.

I thought that was required reading in mathematics. ;^)

Bill Thompson
Re: Looking for someone who contacted me a while back. [message #17797 is a reply to message #17725] Fri, 05 November 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
William Thompson (thompson@orpheus.nascom.nasa.gov) writes:

> Once you realize that
>
> IDL> Print, Where(a NE a)
>
> does work, then it makes a certain amount of sense that
>
> IDL> Print, Where(a EQ !Values.F_NAN)
>
> doesn't work.

Yeah, I knew there was a perfectly plausible answer. :^)

Cheers,

David

P.S. Have you guys ever read Alice in Wonderland? You
would like it.

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Looking for someone who contacted me a while back. [message #17805 is a reply to message #17797] Fri, 05 November 1999 00:00 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
davidf@dfanning.com (David Fanning) writes:

> Todd Bowers (tbowers@nrlssc.navy.mil) writes:

>> Damn! is there *anything* you don't know, David??

> Uh, yeah, *why* Where(a EQ !Values.F_NAN) doesn't work. :-)

Once you realize that

IDL> Print, Where(a NE a)

does work, then it makes a certain amount of sense that

IDL> Print, Where(a EQ !Values.F_NAN)

doesn't work. Any comparison of an NaN value to another value returns false,
even if that other value is also an NaN value.

Actually, it's wrong to think of NaN as a specific value. Instead it's a
collection of "values" (bit patterns), all of which are interpreted as NaN.
There are, in fact, 16,777,214 different bit patterns which translate into a
single precision NaN value, and 9,007,199,254,740,990 possible double precision
NaN values. Half of these values are displayed by IDL as "-NaN" when printed
to the screen, but that's actually not required by the IEEE floating point
standard.

It would have made a certain amount of sense for RSI to adopt the convention
that the expression "a EQ b" would return true when the comparison was between
two NaN values, regardless of the exact bit pattern. Instead they adopted the
convention that this returns false when either (or both) of the variables are
NaN. It seems counterintuitive, but once you get the hang of it, it's not too
bad. It does have the nice property that, if the variables A and B are arrays,
then "Where(a EQ b)" only returns the indices of valid numbers.

William Thompson

P.S. In case you're interested, a floating point number is considered to be
NaN if the exponent field is all ones, and at least one of the bits in the
mantissa field is also set to one, regardless of the sign bit. If the exponent
field is all ones, and the mantissa field is all zeroes, then the value is plus
or minus infinity, depending on the sign bit. Everything else is a valid
floating point number.
Re: Looking for someone who contacted me a while back. [message #17809 is a reply to message #17797] Fri, 05 November 1999 00:00 Go to previous message
T Bowers is currently offline  T Bowers
Messages: 56
Registered: May 1998
Member
>
> P.S. Blue.
>

Damn! You've done it again!
Re: Looking for someone who contacted me a while back. [message #17811 is a reply to message #17797] Fri, 05 November 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Todd Bowers (tbowers@nrlssc.navy.mil) writes:

> Damn! is there *anything* you don't know, David??

Uh, yeah, *why* Where(a EQ !Values.F_NAN) doesn't work. :-)

Cheers,

David

P.S. Blue.

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Looking for someone who contacted me a while back. [message #17812 is a reply to message #17797] Fri, 05 November 1999 00:00 Go to previous message
T Bowers is currently offline  T Bowers
Messages: 56
Registered: May 1998
Member
Damn! is there *anything* you don't know, David??
Ok, what's my favorite color?

Thanks
Todd
Re: Looking for someone who contacted me a while back. [message #17814 is a reply to message #17797] Fri, 05 November 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Todd Bowers (tbowers@nrlssc.navy.mil) writes:

> Oops, I can't remember the name but somebody contacted
> me a few months ago on 3D,4D interpolations. He either does
> or did work for David Fanning Consulting. Told him I'd
> get back in contact with him when I was ready to really
> jump in to the problem. Well... I'm a jumpin'. So please
> contact me if you're you, or if you're not you but are
> interested in accurate 3D+ scatter data stuff.

Dick Jackson, djackson@dfanning.com. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: oplot problem - solved
Next Topic: Center of mass???

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

Current Time: Sat Oct 11 14:19:29 PDT 2025

Total time taken to generate the page: 0.32739 seconds