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

Home » Public Forums » archive » Re: Turning off math error checking for a code block
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Turning off math error checking for a code block [message #28881 is a reply to message #28879] Thu, 17 January 2002 13:55 Go to previous messageGo to previous message
Vapuser is currently offline  Vapuser
Messages: 63
Registered: November 1998
Member
Paul van Delst <paul.vandelst@noaa.gov> writes:

> Vapuser wrote:
>>
>> k-bowman@null.com (Kenneth Bowman) writes:
>>>
>>> I have an array x that is likely to have missing values in it,
>>> indicated by NaN's. I would like to search the array for values
>>> less than x_min. Because of the NaN's, WHERE generates a
>>> floating point error, e.g.,
>>>
>>> IDL> print, x
>>> 0.00000 NaN 2.00000 3.00000
>>> IDL> print, where(x lt 2.0)
>>> 0
>>> % Program caused arithmetic error: Floating illegal operand
>>>
>>
>> Hmmmm..... I don't get this result.
>
> Sure you do - you just have a 0 instead of a 3 as the 4th element of y:
>

Oooopppsss. My error! I guess I just can't read today. For some
reason I thought that Ken's x[3] == 0 too!

mea culpa.


>> IDL> y=[0,!values.f_nan,2,0.]
>
> The where result of the original is one index - the 0th one:
>

Yes.


> IDL> x=[0,!values.f_nan,2,3.]
> IDL> print,where( x LT 2,nx),nx
> 0
> 1
> % Program caused arithmetic error: Floating illegal operand
>
> paulv
>
> p.s. After trying the simple example above, it sure is annoying to
> get that error message. :o\
>

True, but setting !except=0 makes that go away.

whd
--
William Daffer: 818-354-0161: William.Daffer@jpl.nasa.gov
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: load sharing on multiple machines?
Next Topic: Turning off math error checking for a code block

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

Current Time: Wed Oct 08 18:40:09 PDT 2025

Total time taken to generate the page: 0.00404 seconds