Use nt2::is_nan() to test nan instead of x != x trick