On Tue, 13 Apr 2010, Berend Hasselman wrote:
On 13-04-2010, at 18:25, Sven Schreiber wrote:
> Riccardo (Jack) Lucchetti schrieb:
>
>> In my view, NA and NaN are two very different things. As you say, NaN*0
>> == NaN, by the definition of NaN. If you restrict the interpretation of
>> NA to "unknown numbwer (but still a number)", then NA*0==0 makes
sense.
>>
>
> I agree!
>
I don't.
NA == Not Available.
Assume that it is an unknown number. It could be +Inf or -Inf or even NaN.
Even in a numeric context 0*NA = 0 does not make sense.
No. +Inf, -Inf or NaN are _not_ numbers. As long as x _is_ a number,
0*x==0 is true whatever the value of x (known or otherwise).
I feel that The R and Octave result of NA for 0*NA is perfect
reasonable
(in a numeric context). I prefer it.
Matter of taste.
In a string context 0*Na, R will give an error message.
Irrelevant in the present discussion IMO. Besides, R is not the gospel.
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti