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

Home » Public Forums » archive » n_elements and NaN
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: n_elements and NaN [message #74613 is a reply to message #74563] Thu, 27 January 2011 07:24 Go to previous messageGo to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Jan 26, 12:20 pm, Reimar Bauer <R.Ba...@fz-juelich.de> wrote:
> Am 26.01.2011 09:15, schrieb alx:
>
>> On 25 jan, 21:26, Reimar Bauer <R.Ba...@fz-juelich.de> wrote:
>>> Just recognized some fun with NaN or more arguments against NaN.
>
>>> n_elements haven't a NaN keyword
>
>>> Reimar
>
>> Why should it do ?
>> "N_elements(x)" is the old way for "(Size(x))[-1]" or "Size(x,/
>> N_ELEMENTS)".
>> What you want is "where(finite(x), COUNT=number_of_finite_elements,
>> NCOMP=number_of_nan)".
>> The two statements adress two different things: the x size and x
>> content.
>> alx.
>
> This is only a workaround. Until NaN is not completly supported we will
> always have risks to use it. Or having more complicated code as usually
> needed. If you for example expect only to have Long values you would
> never expect NaN numbers there and the data of type float.
>
> Reimar

I'm with alx on this - I would be very annoyed if n_elements looked at
the contents of what it's given rather than just the syntactic
structure (it would be *much* slower, for one thing!).

-Jeremy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL books for beginners
Next Topic: Speed Improvement

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

Current Time: Sat Oct 11 07:49:45 PDT 2025

Total time taken to generate the page: 0.08057 seconds