mirror of
https://github.com/g-truc/glm.git
synced 2024-11-26 02:04:35 +00:00
Fixed test build
This commit is contained in:
parent
5a747d2ae5
commit
d712ac930f
@ -198,21 +198,21 @@ namespace floatBitsToInt
|
||||
glm::vec2 A(1.0f, 2.0f);
|
||||
glm::ivec2 B = glm::floatBitsToInt(A);
|
||||
glm::vec2 C = glm::intBitsToFloat(B);
|
||||
Error += glm::epsilonEqual(A, C, 0.0001f) ? 0 : 1;
|
||||
Error += glm::all(glm::epsilonEqual(A, C, 0.0001f)) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::vec3 A(1.0f, 2.0f, 3.0f);
|
||||
glm::ivec3 B = glm::floatBitsToInt(A);
|
||||
glm::vec3 C = glm::intBitsToFloat(B);
|
||||
Error += glm::epsilonEqual(A, C, 0.0001f) ? 0 : 1;
|
||||
Error += glm::all(glm::epsilonEqual(A, C, 0.0001f)) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::vec4 A(1.0f, 2.0f, 3.0f, 4.0f);
|
||||
glm::ivec4 B = glm::floatBitsToInt(A);
|
||||
glm::vec4 C = glm::intBitsToFloat(B);
|
||||
Error += glm::epsilonEqual(A, C, 0.0001f) ? 0 : 1;
|
||||
Error += glm::all(glm::epsilonEqual(A, C, 0.0001f)) ? 0 : 1;
|
||||
}
|
||||
|
||||
return Error;
|
||||
@ -236,21 +236,21 @@ namespace floatBitsToUint
|
||||
glm::vec2 A(1.0f, 2.0f);
|
||||
glm::uvec2 B = glm::floatBitsToUint(A);
|
||||
glm::vec2 C = glm::uintBitsToFloat(B);
|
||||
Error += glm::epsilonEqual(A, C, 0.0001f) ? 0 : 1;
|
||||
Error += glm::all(glm::epsilonEqual(A, C, 0.0001f)) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::vec3 A(1.0f, 2.0f, 3.0f);
|
||||
glm::uvec3 B = glm::floatBitsToUint(A);
|
||||
glm::vec3 C = glm::uintBitsToFloat(B);
|
||||
Error += glm::epsilonEqual(A, C, 0.0001f) ? 0 : 1;
|
||||
Error += glm::all(glm::epsilonEqual(A, C, 0.0001f)) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::vec4 A(1.0f, 2.0f, 3.0f, 4.0f);
|
||||
glm::uvec4 B = glm::floatBitsToUint(A);
|
||||
glm::vec4 C = glm::uintBitsToFloat(B);
|
||||
Error += glm::epsilonEqual(A, C, 0.0001f) ? 0 : 1;
|
||||
Error += glm::all(glm::epsilonEqual(A, C, 0.0001f)) ? 0 : 1;
|
||||
}
|
||||
|
||||
return Error;
|
||||
@ -550,36 +550,36 @@ namespace round_
|
||||
|
||||
{
|
||||
float A = glm::round(0.0f);
|
||||
Error += glm::epsilonEqual(A, 0.0f, glm::epsilon<float>() ? 0 : 1;
|
||||
Error += glm::epsilonEqual(A, 0.0f, glm::epsilon<float>()) ? 0 : 1;
|
||||
float B = glm::round(0.5f);
|
||||
Error += glm::epsilonEqual(B, 1.0f, glm::epsilon<float>() ? 0 : 1;
|
||||
Error += glm::epsilonEqual(B, 1.0f, glm::epsilon<float>()) ? 0 : 1;
|
||||
float C = glm::round(1.0f);
|
||||
Error += glm::epsilonEqual(C, 1.0f, glm::epsilon<float>() ? 0 : 1;
|
||||
Error += glm::epsilonEqual(C, 1.0f, glm::epsilon<float>()) ? 0 : 1;
|
||||
float D = glm::round(0.1f);
|
||||
Error += glm::epsilonEqual(D, 0.0f, glm::epsilon<float>() ? 0 : 1;
|
||||
Error += glm::epsilonEqual(D, 0.0f, glm::epsilon<float>()) ? 0 : 1;
|
||||
float E = glm::round(0.9f);
|
||||
Error += glm::epsilonEqual(E, 1.0f, glm::epsilon<float>() ? 0 : 1;
|
||||
Error += glm::epsilonEqual(E, 1.0f, glm::epsilon<float>()) ? 0 : 1;
|
||||
float F = glm::round(1.5f);
|
||||
Error += glm::epsilonEqual(F, 2.0f, glm::epsilon<float>() ? 0 : 1;
|
||||
Error += glm::epsilonEqual(F, 2.0f, glm::epsilon<float>()) ? 0 : 1;
|
||||
float G = glm::round(1.9f);
|
||||
Error += glm::epsilonEqual(G, 2.0f, glm::epsilon<float>() ? 0 : 1;
|
||||
Error += glm::epsilonEqual(G, 2.0f, glm::epsilon<float>()) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
float A = glm::round(-0.0f);
|
||||
Error += glm::epsilonEqual(A, 0.0f, glm::epsilon<float>() ? 0 : 1;
|
||||
Error += glm::epsilonEqual(A, 0.0f, glm::epsilon<float>()) ? 0 : 1;
|
||||
float B = glm::round(-0.5f);
|
||||
Error += glm::epsilonEqual(B, -1.0f, glm::epsilon<float>() ? 0 : 1;
|
||||
Error += glm::epsilonEqual(B, -1.0f, glm::epsilon<float>()) ? 0 : 1;
|
||||
float C = glm::round(-1.0f);
|
||||
Error += glm::epsilonEqual(C, -1.0f, glm::epsilon<float>() ? 0 : 1;
|
||||
Error += glm::epsilonEqual(C, -1.0f, glm::epsilon<float>()) ? 0 : 1;
|
||||
float D = glm::round(-0.1f);
|
||||
Error += glm::epsilonEqual(D, 0.0f, glm::epsilon<float>() ? 0 : 1;
|
||||
Error += glm::epsilonEqual(D, 0.0f, glm::epsilon<float>()) ? 0 : 1;
|
||||
float E = glm::round(-0.9f);
|
||||
Error += glm::epsilonEqual(E, -1.0f, glm::epsilon<float>() ? 0 : 1;
|
||||
Error += glm::epsilonEqual(E, -1.0f, glm::epsilon<float>()) ? 0 : 1;
|
||||
float F = glm::round(-1.5f);
|
||||
Error += glm::epsilonEqual(F, -2.0f, glm::epsilon<float>() ? 0 : 1;
|
||||
Error += glm::epsilonEqual(F, -2.0f, glm::epsilon<float>()) ? 0 : 1;
|
||||
float G = glm::round(-1.9f);
|
||||
Error += glm::epsilonEqual(G, -2.0f, glm::epsilon<float>() ? 0 : 1;
|
||||
Error += glm::epsilonEqual(G, -2.0f, glm::epsilon<float>()) ? 0 : 1;
|
||||
}
|
||||
|
||||
return Error;
|
||||
@ -820,7 +820,7 @@ namespace sign
|
||||
std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer,
|
||||
"'sign' only accept integer inputs");
|
||||
|
||||
return (x >> 31) | ((unsigned)-x >> 31);
|
||||
return (x >> 31) | (static_cast<unsigned>(-x) >> 31);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER int sign_alu2(int x)
|
||||
@ -832,7 +832,7 @@ namespace sign
|
||||
# pragma warning(disable : 4146) //cast truncates constant value
|
||||
# endif
|
||||
|
||||
return -((unsigned)x >> 31) | (-(unsigned)x >> 31);
|
||||
return -(static_cast<unsigned>(x) >> 31) | (-static_cast<unsigned>(x) >> 31);
|
||||
|
||||
# if GLM_COMPILER & GLM_COMPILER_VC
|
||||
# pragma warning(pop)
|
||||
@ -846,7 +846,7 @@ namespace sign
|
||||
std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer,
|
||||
"'sign' only accept integer inputs");
|
||||
|
||||
return ((unsigned)-x >> 31) - ((unsigned)x >> 31);
|
||||
return (static_cast<unsigned>(-x) >> 31) - (static_cast<unsigned>(x) >> 31);
|
||||
}
|
||||
|
||||
template<typename genFIType>
|
||||
|
Loading…
Reference in New Issue
Block a user