diff --git a/glm/detail/compute_vector_relational.hpp b/glm/detail/compute_vector_relational.hpp index 4c0e21df..e476d532 100644 --- a/glm/detail/compute_vector_relational.hpp +++ b/glm/detail/compute_vector_relational.hpp @@ -8,7 +8,7 @@ namespace glm{ namespace detail { - template ::is_iec559> + template struct compute_equal { GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 static bool call(T a, T b) diff --git a/glm/detail/func_vector_relational.inl b/glm/detail/func_vector_relational.inl index b081a90d..cab02c3a 100644 --- a/glm/detail/func_vector_relational.inl +++ b/glm/detail/func_vector_relational.inl @@ -57,7 +57,7 @@ namespace glm vec Result; for(length_t i = 0; i < x.length(); ++i) - Result[i] = detail::compute_equal::call(x[i], y[i]); + Result[i] = detail::compute_equal::is_iec559>::call(x[i], y[i]); return Result; } @@ -68,7 +68,7 @@ namespace glm vec Result; for(length_t i = 0; i < x.length(); ++i) - Result[i] = !detail::compute_equal::call(x[i], y[i]); + Result[i] = !detail::compute_equal::is_iec559>::call(x[i], y[i]); return Result; } diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index af211f0f..0c97646d 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -1,8 +1,6 @@ /// @ref core /// @file glm/detail/type_vec1.inl -#include "./compute_vector_relational.hpp" - namespace glm { // -- Implicit basic constructors -- @@ -531,7 +529,7 @@ namespace glm template GLM_FUNC_QUALIFIER bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) { - return detail::compute_equal::call(v1.x, v2.x); + return detail::compute_equal::is_iec559>::call(v1.x, v2.x); } template diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index 2325fd32..4f2faf3b 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -1,8 +1,6 @@ /// @ref core /// @file glm/core/type_tvec2.inl -#include "./compute_vector_relational.hpp" - namespace glm { // -- Implicit basic constructors -- @@ -876,8 +874,8 @@ namespace glm GLM_FUNC_QUALIFIER bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) { return - detail::compute_equal::call(v1.x, v2.x) && - detail::compute_equal::call(v1.y, v2.y); + detail::compute_equal::is_iec559>::call(v1.x, v2.x) && + detail::compute_equal::is_iec559>::call(v1.y, v2.y); } template diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index 0611d1b3..fa69d057 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -1,8 +1,6 @@ /// @ref core /// @file glm/detail/type_tvec3.inl -#include "./compute_vector_relational.hpp" - namespace glm { // -- Implicit basic constructors -- @@ -1026,9 +1024,9 @@ namespace glm GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { return - detail::compute_equal::call(v1.x, v2.x) && - detail::compute_equal::call(v1.y, v2.y) && - detail::compute_equal::call(v1.z, v2.z); + detail::compute_equal::is_iec559>::call(v1.x, v2.x) && + detail::compute_equal::is_iec559>::call(v1.y, v2.y) && + detail::compute_equal::is_iec559>::call(v1.z, v2.z); } template diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index c599f7ad..1ed0789c 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -1,8 +1,6 @@ /// @ref core /// @file glm/detail/type_tvec4.inl -#include "./compute_vector_relational.hpp" - namespace glm{ namespace detail { @@ -132,10 +130,10 @@ namespace detail GLM_FUNC_QUALIFIER static bool call(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) { return - detail::compute_equal::call(v1.x, v2.x) && - detail::compute_equal::call(v1.y, v2.y) && - detail::compute_equal::call(v1.z, v2.z) && - detail::compute_equal::call(v1.w, v2.w); + detail::compute_equal::is_iec559>::call(v1.x, v2.x) && + detail::compute_equal::is_iec559>::call(v1.y, v2.y) && + detail::compute_equal::is_iec559>::call(v1.z, v2.z) && + detail::compute_equal::is_iec559>::call(v1.w, v2.w); } }; diff --git a/glm/gtc/packing.inl b/glm/gtc/packing.inl index c12c1409..eebdc1de 100644 --- a/glm/gtc/packing.inl +++ b/glm/gtc/packing.inl @@ -620,7 +620,7 @@ namespace detail float const ExpSharedP = max(-15.f - 1.f, floor(log2(MaxColor))) + 1.0f + 15.f; float const MaxShared = floor(MaxColor / pow(2.0f, (ExpSharedP - 15.f - 9.f)) + 0.5f); - float const ExpShared = detail::compute_equal::call(MaxShared, pow(2.0f, 9.0f)) ? ExpSharedP + 1.0f : ExpSharedP; + float const ExpShared = detail::compute_equal::is_iec559>::call(MaxShared, pow(2.0f, 9.0f)) ? ExpSharedP + 1.0f : ExpSharedP; uvec3 const ColorComp(floor(Color / pow(2.f, (ExpShared - 15.f - 9.f)) + 0.5f)); diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index e0ab4883..74d2ab24 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -4,7 +4,6 @@ #include "../trigonometric.hpp" #include "../geometric.hpp" #include "../exponential.hpp" -#include "../detail/compute_vector_relational.hpp" #include "epsilon.hpp" #include @@ -603,7 +602,7 @@ namespace detail const T y = static_cast(2) * (q.y * q.z + q.w * q.x); const T x = q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z; - if(detail::compute_equal::call(y, static_cast(0)) && detail::compute_equal::call(x, static_cast(0))) //avoid atan2(0,0) - handle singularity - Matiis + if(detail::compute_equal::is_iec559>::call(y, static_cast(0)) && detail::compute_equal::is_iec559>::call(x, static_cast(0))) //avoid atan2(0,0) - handle singularity - Matiis return static_cast(static_cast(2) * atan(q.x,q.w)); return static_cast(atan(y,x)); @@ -772,7 +771,7 @@ namespace detail { vec<4, bool, Q> Result; for(length_t i = 0; i < x.length(); ++i) - Result[i] = detail::compute_equal::call(x[i], y[i]); + Result[i] = detail::compute_equal::is_iec559>::call(x[i], y[i]); return Result; } @@ -781,7 +780,7 @@ namespace detail { vec<4, bool, Q> Result; for(length_t i = 0; i < x.length(); ++i) - Result[i] = !detail::compute_equal::call(x[i], y[i]); + Result[i] = !detail::compute_equal::is_iec559>::call(x[i], y[i]); return Result; } diff --git a/glm/gtc/ulp.inl b/glm/gtc/ulp.inl index 620be36c..ed018d5e 100644 --- a/glm/gtc/ulp.inl +++ b/glm/gtc/ulp.inl @@ -82,13 +82,13 @@ namespace detail if((ix>0x7f800000) || // x is nan (iy>0x7f800000)) // y is nan return x+y; - if(compute_equal::call(x, y)) + if(compute_equal::is_iec559>::call(x, y)) return y; // x=y, return y if(ix==0) { // x == 0 GLM_SET_FLOAT_WORD(x,(hy&0x80000000)|1);// return +-minsubnormal t = x*x; - if(detail::compute_equal::call(t, x)) + if(detail::compute_equal::call(t, x)) return t; else return x; // raise underflow flag @@ -113,7 +113,7 @@ namespace detail if(hy<0x00800000) // underflow { t = x*x; - if(!detail::compute_equal::call(t, x)) + if(!detail::compute_equal::call(t, x)) { // raise underflow flag GLM_SET_FLOAT_WORD(y,hx); return y; @@ -137,13 +137,13 @@ namespace detail if(((ix>=0x7ff00000)&&((ix-0x7ff00000)|lx)!=0) || // x is nan ((iy>=0x7ff00000)&&((iy-0x7ff00000)|ly)!=0)) // y is nan return x+y; - if(detail::compute_equal::call(x, y)) + if(detail::compute_equal::call(x, y)) return y; // x=y, return y if((ix|lx)==0) { // x == 0 GLM_INSERT_WORDS(x, hy & 0x80000000, 1); // return +-minsubnormal t = x*x; - if(detail::compute_equal::call(t, x)) + if(detail::compute_equal::call(t, x)) return t; else return x; // raise underflow flag @@ -171,7 +171,7 @@ namespace detail if(hy<0x00100000) { // underflow t = x*x; - if(!detail::compute_equal::call(t, x)) + if(!detail::compute_equal::call(t, x)) { // raise underflow flag GLM_INSERT_WORDS(y,hx,lx); return y; diff --git a/glm/gtx/log_base.inl b/glm/gtx/log_base.inl index 981bacc7..64707e7a 100644 --- a/glm/gtx/log_base.inl +++ b/glm/gtx/log_base.inl @@ -6,7 +6,6 @@ namespace glm template GLM_FUNC_QUALIFIER genType log(genType const& x, genType const& base) { - assert(!detail::compute_equal::call(x, static_cast(0))); return glm::log(x) / glm::log(base); } diff --git a/glm/gtx/scalar_relational.inl b/glm/gtx/scalar_relational.inl index 8da72362..c616e07e 100644 --- a/glm/gtx/scalar_relational.inl +++ b/glm/gtx/scalar_relational.inl @@ -50,7 +50,7 @@ namespace glm T const& y ) { - return detail::compute_equal::call(x, y); + return detail::compute_equal::is_iec559>::call(x, y); } template @@ -60,7 +60,7 @@ namespace glm T const& y ) { - return !detail::compute_equal::call(x, y); + return !detail::compute_equal::is_iec559>::call(x, y); } GLM_FUNC_QUALIFIER bool any