isValid:  bug with NaN comparison