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

Home » Public Forums » archive » Comparison operators and floating-point errors
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
Comparison operators and floating-point errors [message #70560] Mon, 19 April 2010 11:31
MarioIncandenza is currently offline  MarioIncandenza
Messages: 231
Registered: February 2005
Senior Member
IDL> nan=1/0.0
% Program caused arithmetic error: Floating divide by 0
IDL> print, -0.1 > nan
Inf
IDL> print, -0.1 < nan
-0.100000
IDL> print, 1 gt nan
0
IDL> print, 1 lt nan
1

I thought the rule was "Any calculation involving a NaN will produce
NaN."
Has it been this way since the dawn of time? I'm sure it has.

I have found a few uses for NaN in IDL over the years, and now I have
to come up with new ones.

For instance (the one that led me to track this down), I use NaN to
exclude areas from contour plots. There are other ways, but none quite
as simple and flexible.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Help needed!!
Next Topic: Re: Comparison operators and floating-point errors

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

Current Time: Wed Oct 08 20:09:42 PDT 2025

Total time taken to generate the page: 0.01579 seconds