The example is convincing, but note that we have
some smart behaviour elsewhere in Stata. Thus
di max(1,2.71828,3.14159,.)
yields 3.14159. The result of -max()- is missing if and
only if all its arguments are missing. I'd say that
was right, at least in the important sense that
is what is usually desired.
Now substitute NaN for missing. What should the
answer be?
It could well be exactly the same. Stata has, as Nick suggests, a good deal
of sensible code that takes that which _Stata considers to be_ as missing
and does appropriate things with it. For instance, summarize considers only
non-missing cases when it generates summary stats. The problem comes when
it is possible to include missings in a Boolean statement without realizing
that you are doing so. I recently suggested to my research assistant that
he could write much cleaner code if he used Booleans rather than a long
string of this or this or this or that...but then the Booleans all have to
have 'and variable < .' appended to get them to work properly.