Added and to *GLM_EXT_scalar_common* and *GLM_EXT_vector_common*

This commit is contained in:
Christophe
2020-11-23 17:02:32 +01:00
parent c59117ebd0
commit 2a8664fe50
9 changed files with 153 additions and 59 deletions

View File

@@ -298,6 +298,36 @@ static int test_mirrorRepeat()
return Error;
}
static int test_iround()
{
int Error = 0;
for(float f = 0.0f; f < 3.1f; f += 0.05f)
{
int RoundFast = static_cast<int>(glm::iround(f));
int RoundSTD = static_cast<int>(glm::round(f));
Error += RoundFast == RoundSTD ? 0 : 1;
assert(!Error);
}
return Error;
}
static int test_uround()
{
int Error = 0;
for(float f = 0.0f; f < 3.1f; f += 0.05f)
{
int RoundFast = static_cast<int>(glm::uround(f));
int RoundSTD = static_cast<int>(glm::round(f));
Error += RoundFast == RoundSTD ? 0 : 1;
assert(!Error);
}
return Error;
}
int main()
{
int Error = 0;
@@ -323,5 +353,8 @@ int main()
Error += test_mirrorClamp();
Error += test_mirrorRepeat();
Error += test_iround();
Error += test_uround();
return Error;
}

View File

@@ -303,6 +303,36 @@ static int test_mirrorRepeat()
return Error;
}
static int test_iround()
{
int Error = 0;
for(float f = 0.0f; f < 3.1f; f += 0.05f)
{
int RoundFast = static_cast<int>(glm::iround(f));
int RoundSTD = static_cast<int>(glm::round(f));
Error += RoundFast == RoundSTD ? 0 : 1;
assert(!Error);
}
return Error;
}
static int test_uround()
{
int Error = 0;
for(float f = 0.0f; f < 3.1f; f += 0.05f)
{
int RoundFast = static_cast<int>(glm::uround(f));
int RoundSTD = static_cast<int>(glm::round(f));
Error += RoundFast == RoundSTD ? 0 : 1;
assert(!Error);
}
return Error;
}
int main()
{
int Error = 0;
@@ -328,5 +358,8 @@ int main()
Error += test_mirrorClamp();
Error += test_mirrorRepeat();
Error += test_iround();
Error += test_uround();
return Error;
}