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

Home » Public Forums » archive » Re: VALUE_LOCATE and NaNs
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: VALUE_LOCATE and NaNs [message #81815 is a reply to message #81813] Thu, 25 October 2012 08:05 Go to previous messageGo to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On 10/25/12 9:48 AM, Fab wrote:
> On 10/25/2012 03:41 PM, Kai Muehlbauer wrote:
>>
>> I can confirm:
>>
>> IDL> print, !VERSION
>> { x86_64 linux unix linux 7.1.1 Aug 21 2009 64 64}
>>
>> IDL> data = FINDGEN(10) & data[0] = !VALUES.F_NAN
>> IDL> p = VALUE_LOCATE(LINDGEN(10), data) & print, p[0]
>> -1
>> % Program caused arithmetic error: Floating illegal operand
>> IDL>
>>
>> Cheers,
>> Kai
>>
>
> At least the answer is right, but the warning is there ;-)
> So three different behaviours of value locate with three input types:
>
> IDL> data = FINDGEN(10) & data[0] = !VALUES.F_NAN
> IDL> p = VALUE_LOCATE(INDGEN(10), data) & print, p[0]
> 0
> % Program caused arithmetic error: Floating illegal operand
> IDL> p = VALUE_LOCATE(LINDGEN(10), data) & print, p[0]
> -1
> % Program caused arithmetic error: Floating illegal operand
> IDL> p = VALUE_LOCATE(FINDGEN(10), data) & print, p[0]
> -1
>
>

I agree with Craig - there is no well-defined answer for what
VALUE_LOCATE should return when faced with a NaN. But it also shouldn't
give different answers depending on the type of location array.

-Jeremy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: random numbers with gamma distribution
Next Topic: new graphics legend function: problems with symbol fill color

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

Current Time: Thu Oct 09 22:01:58 PDT 2025

Total time taken to generate the page: 0.72163 seconds