Commit 35f44e64 authored by Sebastian Wolf's avatar Sebastian Wolf

Added misc::abs

parent a70657b7
Pipeline #1300 passed with stages
in 17 minutes and 40 seconds
......@@ -37,6 +37,12 @@ namespace xerus {
return (T(0) < _value) - (_value < T(0));
}
///@brief: Calculates the absolute value of _value.
template<class T>
constexpr T abs(const T _value) noexcept {
return (_value < 0 ) ? -_value : _value;
}
///@brief: Calculates _a*_a.
template<class T>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment