KFR

Saturated arithmetic functions

satadd

template<typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value), typename Tout = common_type<T1, T2>>
Tout satadd(const T1 &x, const T2 &y)

Adds two arguments using saturation

Source:

template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value),
          typename Tout = common_type<T1, T2>>
KFR_INTRIN Tout satadd(const T1& x, const T2& y)
template<typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
internal::expression_function<fn::satadd, E1, E2> satadd(E1 &&x, E2 &&y)

Creates an expression that adds two arguments using saturation

Source:

template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
KFR_INTRIN internal::expression_function<fn::satadd, E1, E2> satadd(E1&& x, E2&& y)

satsub

template<typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value), typename Tout = common_type<T1, T2>>
Tout satsub(const T1 &x, const T2 &y)

Subtracts two arguments using saturation

Source:

template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value),
          typename Tout = common_type<T1, T2>>
KFR_INTRIN Tout satsub(const T1& x, const T2& y)
template<typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
internal::expression_function<fn::satsub, E1, E2> satsub(E1 &&x, E2 &&y)

Creates an expression that subtracts two arguments using saturation

Source:

template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
KFR_INTRIN internal::expression_function<fn::satsub, E1, E2> satsub(E1&& x, E2&& y)