|
|
|
@ -37,13 +37,13 @@ namespace glm{ |
|
|
|
|
namespace detail |
|
|
|
|
{ |
|
|
|
|
template <typename genFIType, bool /*signed*/> |
|
|
|
|
struct Abs_ |
|
|
|
|
struct compute_abs |
|
|
|
|
{}; |
|
|
|
|
|
|
|
|
|
template <typename genFIType> |
|
|
|
|
struct Abs_<genFIType, true> |
|
|
|
|
struct compute_abs<genFIType, true> |
|
|
|
|
{ |
|
|
|
|
GLM_FUNC_QUALIFIER static genFIType get(genFIType const & x) |
|
|
|
|
GLM_FUNC_QUALIFIER static genFIType call(genFIType const & x) |
|
|
|
|
{ |
|
|
|
|
GLM_STATIC_ASSERT( |
|
|
|
|
std::numeric_limits<genFIType>::is_iec559 || std::numeric_limits<genFIType>::is_signed, |
|
|
|
@ -54,9 +54,9 @@ namespace detail |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template <typename genFIType> |
|
|
|
|
struct Abs_<genFIType, false> |
|
|
|
|
struct compute_abs<genFIType, false> |
|
|
|
|
{ |
|
|
|
|
GLM_FUNC_QUALIFIER static genFIType get(genFIType const & x) |
|
|
|
|
GLM_FUNC_QUALIFIER static genFIType call(genFIType const & x) |
|
|
|
|
{ |
|
|
|
|
GLM_STATIC_ASSERT( |
|
|
|
|
!std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer, |
|
|
|
@ -73,7 +73,7 @@ namespace detail |
|
|
|
|
genFIType const & x |
|
|
|
|
) |
|
|
|
|
{ |
|
|
|
|
return detail::Abs_<genFIType, std::numeric_limits<genFIType>::is_signed>::get(x); |
|
|
|
|
return detail::compute_abs<genFIType, std::numeric_limits<genFIType>::is_signed>::call(x); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
VECTORIZE_VEC(abs) |
|
|
|
|