@ -87,29 +87,32 @@ namespace glm
VECTORIZE_VEC(exp2)
namespace detail
namespace _ detail
{
template <int PATH = float_or_int_value::GLM_ERROR>
struct compute_log2
template <int _ PATH = detail:: float_or_int_value::GLM_ERROR>
struct _ compute_log2
{
template <typename T>
T operator() (T const & Value) const
T operator() (T const & Value) const;
/*
{
GLM_STATIC_ASSERT(0, "'log2' parameter has an invalid template parameter type. GLM core features only supports floating-point types, include <glm/gtx/integer.hpp> for integer types support. Others types are not supported.");
return Value;
}
*/
};
template <>
struct compute_log2<float_or_int_value::GLM_FLOAT>
struct _ compute_log2<detail:: float_or_int_value::GLM_FLOAT>
{
template <typename T>
T operator() (T const & Value) const
{
return ::std::log(Value) / T(0.69314718055994530941723212145818);
return T( ::std::log(Value) ) / T(0.69314718055994530941723212145818);
}
};
}//namespace detail
}//namespace _detail
// log2, ln2 = 0.69314718055994530941723212145818f
template <typename genType>
@ -119,7 +122,7 @@ namespace detail
)
{
assert(x > genType(0)); // log2 is only defined on the range (0, inf]
return detail::compute_log2<detail::float_or_int_trait<genType>::ID>()(x);
return _ detail::_ compute_log2<detail::float_or_int_trait<genType>::ID>()(x);
}
VECTORIZE_VEC(log2)