Fixed equal ULP variation when using negative sign #965

This commit is contained in:
Christophe Riccio
2019-11-02 12:46:15 +01:00
parent 11089f6d7e
commit 919e72f5dd
3 changed files with 23 additions and 4 deletions

View File

@@ -71,6 +71,25 @@ static int test_notEqual_ulps()
return Error;
}
static int test_equal_sign()
{
int Error = 0;
Error += !glm::equal(-0.0f, 0.0f, 2) ? 0 : 1;
Error += !glm::equal(-0.0, 0.0, 2) ? 0 : 1;
Error += !glm::equal(-1.0f, 2.0f, 2) ? 0 : 1;
Error += !glm::equal(-1.0, 2.0, 2) ? 0 : 1;
Error += !glm::equal(-0.00001f, 1.00000f, 2) ? 0 : 1;
Error += !glm::equal(-0.00001, 1.00000, 2) ? 0 : 1;
Error += !glm::equal(-1.0f, 1.0f, 2) ? 0 : 1;
Error += !glm::equal(-1.0, 1.0, 2) ? 0 : 1;
return Error;
}
int main()
{
int Error = 0;
@@ -81,5 +100,7 @@ int main()
Error += test_equal_ulps();
Error += test_notEqual_ulps();
Error += test_equal_sign();
return Error;
}