A C++ template library for embedded applications
MIT licensed
Designed and
maintained by
John Wellbelove

absolute

A template functions that return the absolute value.
____________________________________________________________________________________________________
template <typename T>
ETL_CONSTEXPR T absolute(T value)
Returns the absolute of value.

If T is int8_t:-
0 => 0
127 => 127
-127 => 127
____________________________________________________________________________________________________
template <typename T>
ETL_CONSTEXPR etl::make_unsigned_t<T> absolute_unsigned(T value)
Returns the absolute of value, cast to the unsigned version of type T.

If T is int8_t:-

Return type is etl::make_unsigned_t<T>
0 => 0
127 => 127
-127 => 127
-128 => 128
absolute.h