wrap min/max calls in brackets

This commit is contained in:
Steven French 2024-08-19 14:44:44 +12:00
parent 33b4a621a6
commit 9921bfb56f
2 changed files with 6 additions and 6 deletions

View File

@ -60,7 +60,7 @@ namespace glm
//VectorMagnitude to 0. here; we could use denorm_int() compiling a
//project with unsafe maths optimizations might make the comparison
//always false, even when VectorMagnitude is 0.
if (VectorMagnitude < std::numeric_limits<T>::min()) {
if (VectorMagnitude < (std::numeric_limits<T>::min)()) {
//Equivalent to raising a real number to a power
return qua<T, Q>::wxyz(pow(x.w, y), 0, 0, 0);
}

View File

@ -16,8 +16,8 @@ namespace detail
{
GLM_FUNC_QUALIFIER static vec<L, floatType, Q> call(vec<L, T, Q> const& v)
{
floatType const Min = static_cast<floatType>(std::numeric_limits<T>::min());
floatType const Max = static_cast<floatType>(std::numeric_limits<T>::max());
floatType const Min = static_cast<floatType>((std::numeric_limits<T>::min)());
floatType const Max = static_cast<floatType>((std::numeric_limits<T>::max)());
return (vec<L, floatType, Q>(v) - Min) / (Max - Min) * static_cast<floatType>(2) - static_cast<floatType>(1);
}
};
@ -27,7 +27,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static vec<L, floatType, Q> call(vec<L, T, Q> const& v)
{
return vec<L, floatType, Q>(v) / static_cast<floatType>(std::numeric_limits<T>::max());
return vec<L, floatType, Q>(v) / static_cast<floatType>((std::numeric_limits<T>::max)());
}
};
@ -49,7 +49,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, floatType, Q> const& v)
{
floatType const Max = static_cast<floatType>(std::numeric_limits<T>::max()) + static_cast<floatType>(0.5);
floatType const Max = static_cast<floatType>((std::numeric_limits<T>::max)()) + static_cast<floatType>(0.5);
vec<L, floatType, Q> const Scaled(v * Max);
vec<L, T, Q> const Result(Scaled - static_cast<floatType>(0.5));
return Result;
@ -61,7 +61,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, floatType, Q> const& v)
{
return vec<L, T, Q>(vec<L, floatType, Q>(v) * static_cast<floatType>(std::numeric_limits<T>::max()));
return vec<L, T, Q>(vec<L, floatType, Q>(v) * static_cast<floatType>((std::numeric_limits<T>::max)()));
}
};