The IsNaN
property of the Vector3
struct checks if any of the vector's components (x, y, or z) are NaN
(Not a Number). This is useful for validating vector data to ensure it contains valid numerical values.
The IsNaN
property of the Vector3
struct checks if any of the vector's components (x, y, or z) are NaN
(Not a Number). This is useful for validating vector data to ensure it contains valid numerical values.
Use the IsNaN
property to verify if a Vector3
instance contains any NaN
values. This can help prevent errors in calculations or operations that require valid numerical data.
Vector3 vector = new Vector3(float.NaN, 0, 0); bool hasNaN = vector.IsNaN; // hasNaN will be true because the x component is NaN.