On 04/28/11 14:50, Carnë Draug wrote:
> Again, I'm sorry if this is wrong but I'm but a biologist, very little
> background on maths. If my understanding is correct NaN == undefined.
> If you add something to undefined, shouldn't it be undefined as well?
> If so, all values beyond a NaN ocurrence will be NaN in a cumsum.
>
> Undefined is not the same as 0 which seems to be the behavior you expect.

nan is not 0, that's for sure. But in the nan package, nans are simply 
neglected, so it behaves as 0 for addition and as 1 for multiplication (sort 
of).

For example:

octave:> nansum([[2 5 NaN 7]])
ans =  14

M.

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to