NaN and 0

You have to remove “:Number= NaN”, and add reference to arguments of myFunc, because, if function recieves null it substitutes default value for the argument, it doesnt convert null to whatever the type of argument may be.
i.e.

function myFunc(i:*):void
{
 var ai:* = i;
 trace(ai);
 if (ai == null) trace ("argument #0 is null!");
 if (!isNaN(ai)) trace("May be a number!");
 if (isNaN(ai)) trace ("Not a number, but may be cast to number!");
 if (isNaN(ai/1)) trace ("Positively, not a number!");
 if (ai != NaN) trace ("ai != NaN");
}
function getUnknownValue():* {
 return null;
}
myFunc(0);
trace("-----------------");
myFunc(getUnknownValue());
myFunc('a');
trace("-----------------");