mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 04:31:47 +00:00
Fixed comparing floating point with == or != is unsafe error
This commit is contained in:
parent
4dce0e338d
commit
76707df1f1
@ -112,7 +112,7 @@ namespace modf_
|
||||
glm::vec4 I(0.0f);
|
||||
glm::vec4 A = glm::modf(X, I);
|
||||
|
||||
Error += I == glm::vec4(1.0f) ? 0 : 1;
|
||||
Error += glm::ivec4(I) == glm::ivec4(1.0f) ? 0 : 1;
|
||||
Error += glm::all(glm::epsilonEqual(A, glm::vec4(0.1f, 0.2f, 0.5f, 0.7f), 0.00001f)) ? 0 : 1;
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ namespace modf_
|
||||
glm::dvec4 I(0.0);
|
||||
glm::dvec4 A = glm::modf(X, I);
|
||||
|
||||
Error += I == glm::dvec4(1.0) ? 0 : 1;
|
||||
Error += glm::ivec4(I) == glm::ivec4(1.0) ? 0 : 1;
|
||||
Error += glm::all(glm::epsilonEqual(A, glm::dvec4(0.1, 0.2, 0.5, 0.7), 0.000000001)) ? 0 : 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user