You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
glm::isfinite from compatibility.inl returns false for float or double values that are less than or equal to 0.
The bug is in line 49:
return x >= std::numeric_limits<genType>::min() && x <= std::numeric_limits<genType>::max();
For floating point types with denormalization (see std::numeric_limits::has_denorm) std::numeric_limits::min() returns the smallest finite number greater than 0 that the type can represent instead of the smallest finite number overall.
The following should give the correct result for integer and floating point types:
if (std::numeric_limits<genType>::is_integer || std::denorm_absent == std::numeric_limits<genType>::has_denorm)
{
return std::numeric_limits<genType>::min() <= x && std::numeric_limits<genType>::max() >= x;
}
else
{
return -std::numeric_limits<genType>::max() <= x && std::numeric_limits<genType>::max() >= x;
}
The text was updated successfully, but these errors were encountered:
glm::isfinite
fromcompatibility.inl
returnsfalse
forfloat
ordouble
values that are less than or equal to 0.The bug is in line 49:
return x >= std::numeric_limits<genType>::min() && x <= std::numeric_limits<genType>::max();
For floating point types with denormalization (see
std::numeric_limits::has_denorm
)std::numeric_limits::min()
returns the smallest finite number greater than 0 that the type can represent instead of the smallest finite number overall.The following should give the correct result for integer and floating point types:
The text was updated successfully, but these errors were encountered: