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


A template function that returns the absolute value.

The function has two variants; one for signed and one for unsigned types.
The unsigned variant merely returns the parameter value.
The variant is chosen at compile time according to the parameter type.
template <typename T>
T absolute(T value)

For C++11 and above
template <typename T>
constexpr T absolute(T value)