mirror of
https://github.com/g-truc/glm.git
synced 2024-11-29 11:24:35 +00:00
fix: generalize epsilonEqual
This commit is contained in:
parent
fc8f4bb442
commit
a063df8336
@ -6,24 +6,8 @@
|
||||
|
||||
namespace glm
|
||||
{
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER bool epsilonEqual
|
||||
(
|
||||
float const& x,
|
||||
float const& y,
|
||||
float const& epsilon
|
||||
)
|
||||
{
|
||||
return abs(x - y) < epsilon;
|
||||
}
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER bool epsilonEqual
|
||||
(
|
||||
double const& x,
|
||||
double const& y,
|
||||
double const& epsilon
|
||||
)
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER bool epsilonEqual(genType const& x, genType const& y, genType const& epsilon)
|
||||
{
|
||||
return abs(x - y) < epsilon;
|
||||
}
|
||||
@ -40,14 +24,8 @@ namespace glm
|
||||
return lessThan(abs(x - y), vec<L, T, Q>(epsilon));
|
||||
}
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER bool epsilonNotEqual(float const& x, float const& y, float const& epsilon)
|
||||
{
|
||||
return abs(x - y) >= epsilon;
|
||||
}
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER bool epsilonNotEqual(double const& x, double const& y, double const& epsilon)
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER bool epsilonNotEqual(genType const& x, genType const& y, genType const& epsilon)
|
||||
{
|
||||
return abs(x - y) >= epsilon;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user