9 template<
typename genFIType,
bool >
13 template<
typename genFIType>
14 struct compute_abs<genFIType, true>
16 GLM_FUNC_QUALIFIER GLM_CONSTEXPR
static genFIType call(genFIType x)
19 std::numeric_limits<genFIType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<genFIType>::is_signed,
20 "'abs' only accept floating-point and integer scalar or vector inputs");
22 return x >= genFIType(0) ? x : -x;
27 #if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
29 struct compute_abs<float, true>
31 GLM_FUNC_QUALIFIER
static float call(
float x)
38 template<
typename genFIType>
39 struct compute_abs<genFIType, false>
41 GLM_FUNC_QUALIFIER GLM_CONSTEXPR
static genFIType call(genFIType x)
44 (!std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer),
45 "'abs' only accept floating-point and integer scalar or vector inputs");