Re: manipulating structures [message #53350 is a reply to message #53344] |
Mon, 09 April 2007 03:21   |
Foldy Lajos
Messages: 268 Registered: October 2001
|
Senior Member |
|
|
On Sun, 8 Apr 2007, David Fanning wrote:
> Lajos = writes:
>
>> You are summing an empty array, if the /NaN keyword (= discard NaNs) was
>> set. So, what is the sum of an empty array: 0 or Nan? :-)
>
> Well, whatever it is, it probably ought be to the same
> as MEAN, don't you think?
>
> Cheers,
>
> David
MEAN has an extra division, 0/0 and NaN/0 are both NaN, so it can differ
from the result of TOTAL.
I don't know which result is better, and I guess different people have
different preferences. There is a third option: IDL reports an error, as
empty arrays are illegal.
regards,
lajos
|
|
|