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

Home » Public Forums » archive » Re: IDL 8.2.2 and PLOT with NaN values
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: IDL 8.2.2 and PLOT with NaN values [message #83696 is a reply to message #83679] Wed, 27 March 2013 14:39 Go to previous messageGo to previous message
Lajos Foldy is currently offline  Lajos Foldy
Messages: 176
Registered: December 2011
Senior Member
On Wednesday, March 27, 2013 10:10:23 PM UTC+1, wlandsman wrote:
> Not only are the math errors hardware dependent, but today I came across the fact that it can depend on how the array is ordered.
>
> IDL> print,min([2.,!values.f_nan,3.])
> 2.00000
> IDL> print,min([!values.f_nan,3.,2.])
> NaN
> IDL> print,!version
> { x86_64 linux unix linux 8.2.2 Jan 23 2013 64 64}
>
> The help for MIN says
>
> "Note: If the MIN function is run on an array containing NaN values and the NAN keyword is not set, an invalid result will occur."
>
> but this should probably read
>
> Note: If the MIN function is run on an array containing NaN values and the NAN keyword is not set, an invalid result **may** occur.

This can be explained: a MIN function implementation may look like:

min=arr[0]
for j=1,n_elements(arr)-1 do min=min<arr[j]

so a non-NaN first elements is vital (without /NaN). For small arrays, only this first element counts. For large arrays, multithreading comes into the picture and there are multiple first elements (each thread has one somewhere in the array).

regards,
Lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: A Healthy Alternative to Takeaway Regret
Next Topic: cursor command

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

Current Time: Thu Oct 09 18:59:40 PDT 2025

Total time taken to generate the page: 0.63911 seconds