Its in the FAQ: How do I determine whether a scalar is a number/whole/integer/float?
In reply to Re: Detect if a scalar is NaN by dorward in thread Detect if a scalar is NaN by User36