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

This commit is contained in:
Groove 2018-07-28 18:16:07 +02:00
parent f9dc1d587f
commit 291287e45d

View File

@ -49,11 +49,8 @@ int test_ctr()
{6, 7, 8},
{9, 10, 11}};
for(glm::length_t i = 0; i < m0.length(); ++i)
Error += glm::all(glm::equal(m0[i], m2[i])) ? 0 : 1;
for(glm::length_t i = 0; i < m1.length(); ++i)
Error += glm::all(glm::equal(m1[i], m2[i])) ? 0 : 1;
Error += glm::all(glm::equal(m0, m2, glm::epsilon<float>())) ? 0 : 1;
Error += glm::all(glm::equal(m1, m2, glm::epsilon<float>())) ? 0 : 1;
std::vector<glm::mat4x3> v1{
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},