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

This commit is contained in:
Groove 2018-07-28 17:14:02 +02:00
parent 633ca9a2f0
commit f9dc1d587f
8 changed files with 16 additions and 16 deletions

View File

@ -24,8 +24,8 @@ static int test_operators()
glm::mat2x3 o = m / x;
glm::mat2x3 p = x * m;
glm::mat2x3 q = m * x;
bool R = m != q;
bool S = m == l;
bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
return (S && !R) ? 0 : 1;
}

View File

@ -25,8 +25,8 @@ static int test_operators()
glm::mat2x4 o = m / x;
glm::mat2x4 p = x * m;
glm::mat2x4 q = m * x;
bool R = m != q;
bool S = m == l;
bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
return (S && !R) ? 0 : 1;
}

View File

@ -24,8 +24,8 @@ static bool test_operators()
glm::mat3x2 o = m / x;
glm::mat3x2 p = x * m;
glm::mat3x2 q = m * x;
bool R = m != q;
bool S = m == l;
bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
return (S && !R) ? 0 : 1;
}

View File

@ -51,8 +51,8 @@ static int test_operators()
glm::mat3x3 o = m / x;
glm::mat3x3 p = x * m;
glm::mat3x3 q = m * x;
bool R = m != q;
bool S = m == l;
bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
return (S && !R) ? 0 : 1;
}

View File

@ -25,8 +25,8 @@ static bool test_operators()
glm::mat3x4 o = m / x;
glm::mat3x4 p = x * m;
glm::mat3x4 q = m * x;
bool R = m != q;
bool S = m == l;
bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
return (S && !R) ? 0 : 1;
}

View File

@ -24,8 +24,8 @@ static int test_operators()
glm::mat4x2 o = m / x;
glm::mat4x2 p = x * m;
glm::mat4x2 q = m * x;
bool R = m != q;
bool S = m == l;
bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
return (S && !R) ? 0 : 1;
}

View File

@ -24,8 +24,8 @@ static int test_operators()
glm::mat4x3 o = m / x;
glm::mat4x3 p = x * m;
glm::mat4x3 q = m * x;
bool R = m != q;
bool S = m == l;
bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
return (S && !R) ? 0 : 1;
}

View File

@ -72,8 +72,8 @@ static bool test_operators()
glm::mat4x4 o = m / x;
glm::mat4x4 p = x * m;
glm::mat4x4 q = m * x;
bool R = m != q;
bool S = m == l;
bool R = glm::any(glm::notEqual(m, q, glm::epsilon<float>()));
bool S = glm::all(glm::equal(m, l, glm::epsilon<float>()));
return (S && !R) ? 0 : 1;
}