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

Home » Public Forums » archive » Re: Comparison operators and floating-point errors
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: Comparison operators and floating-point errors [message #70553 is a reply to message #70552] Mon, 19 April 2010 14:45 Go to previous messageGo to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Apr 19, 6:24 pm, Ed Hyer <ejh...@gmail.com> wrote:
> On Apr 19, 1:36 pm, Craig Markwardt <craig.markwa...@gmail.com> wrote:
>
>> Right.  Try setting NAN=0.0/0.0 or NAN=!values.f_nan.
>
> OK, so for the purpose of masking an array with a binary mask, I had
> been using
>
> MASKED_DATA = DATA / FLOAT(MASK)
>
> and should instead use
>
> MASKED_DATA = (DATA * MASK) / FLOAT(MASK)
>
> in order to ensure that the masked values are all NaN.

Or

w=where(~mask,nw)
if (nw gt 0) then masked_data[w]=!values.d_nan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Comparison operators and floating-point errors
Next Topic: Re: Declaring large vectors in IDL

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

Current Time: Wed Oct 08 15:20:01 PDT 2025

Total time taken to generate the page: 0.01017 seconds