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

Home » Public Forums » archive » Re: Incorrect behavior of /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: Incorrect behavior of /NAN [message #30024 is a reply to message #30021] Thu, 04 April 2002 10:38 Go to previous messageGo to previous message
Jaco van Gorkom is currently offline  Jaco van Gorkom
Messages: 97
Registered: November 2000
Member
"Paul van Delst" <paul.vandelst@noaa.gov> wrote in message
news:3CAC9914.B52D1669@noaa.gov...
> Kenneth Bowman wrote:
>> ....
>> IDL> print, mean([a, a], /nan)
>> NaN
>
> I think the last result *here* is wrong :o) Shouldn't it be 1.0? What is
MEAN in this case
> but:
>
> total([a,a],/NAN) / n_elements(non-nan values only)
>
> Both the numerator and denominator are 0.

So you mean that 0 / 0 = 1.0 ? Or 0. / 0. = 1.0 ?
In any case, IDL seems to disagree with you here: :-)

IDL> print, 0./0.
-NaN
% Program caused arithmetic error: Floating illegal operand

IDL> print, 0/0
0
% Program caused arithmetic error: Integer divide by 0

Jaco
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Need help identifying left most zero bit
Next Topic: Interfacing the functions

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

Current Time: Sun Nov 30 09:59:49 PST 2025

Total time taken to generate the page: 1.44110 seconds