[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sumskipnan(nan) = 0 ?
From: |
Thomas Shores |
Subject: |
Re: sumskipnan(nan) = 0 ? |
Date: |
Fri, 7 Sep 2007 14:43:56 -0500 |
User-agent: |
KMail/1.9.7 |
> >> sumskipnan(nan) = 0 ?
> >
> >I'm guessing that the sum of the input with all the NaN's removed
> > is zero. That is the sum of no numbers is considered 0.
>
> That seems logical. Take the set of arguments, remove NaNs, get
> an empty set. I think that the sum of an empty set of numbers
> should be 0. Why should it be different?
Actually, it's not only logical, it's the only choice. Look at it
this way: the sum of elements over the union of disjoint index sets
A and B should be the sum of the sum over indices in A plus the sum
over indices in B. Now if B is the empty set, the union of the sets
is just A, and A and B are disjoint. Hence the sum over A union B
should be the sum over A. Hence the sum over B must be zero.
Tom Shores