Why 1.0 doesn't equal to 1.0

I broke a vector and compare the Z(1.0) value to 1.0, but it returned false

I think it shouldn’t be happened. Does anyone know how to fix it?

If you’re comparing floats or vectors use

image

Floating point arithmetic is approximate.

1 Like