Fixed error: comparing floating point with == or != is unsafe

This commit is contained in:
Groove 2018-07-28 19:26:54 +02:00
parent b2ba0c317d
commit ef955b2bf5
2 changed files with 4 additions and 4 deletions

View File

@ -112,8 +112,8 @@ int test_vec4_ctor()
# endif//GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR
{
glm::vec4 A(1);
glm::vec4 B(1, 1, 1, 1);
glm::ivec4 A(1);
glm::ivec4 B(1, 1, 1, 1);
Error += A == B ? 0 : 1;
}

View File

@ -18,8 +18,8 @@ static int test_operators()
int Error = 0;
{
glm::vec2 A(1.0f);
glm::vec2 B(1.0f);
glm::ivec2 A(1.0f);
glm::ivec2 B(1.0f);
Error += A != B ? 1 : 0;
Error += A == B ? 0 : 1;
}