chsvlib
chsv helper source code

◆ abs()

constexpr ArithmeticType Chusov::Math::abs ( ArithmeticType  val)
constexprnoexcept

Returns an absolute value of a scalar.

Template Parameters
ArithmeticTypeA type of the scalar.
Parameters
valThe scalar.
Returns
An absolute value of the scalar.

The function is only participates in overload resolution for types ArithmeticType for which either std::is_signed<ArithmeticType>::value or std::is_unsigned<ArithmeticType>::value is true.

If ArithmeticType denotes an unsigned type, the function performs no action and just forwards the argument (passed in as a universal reference) back to the caller.