20 [[nodiscard]] constexpr T
abs(T value) noexcept
22 static_assert(std::is_integral_v<T>,
"T must be an integral");
23 if constexpr (std::is_signed_v<T>) {
24 return value < T{0} ? -value : value;
40 static_assert(std::is_integral_v<T>,
"T must be an integral");
42 constexpr
auto base = T{10};
46 while (value /= base) {
61 template <auto Base,
typename T>
62 [[nodiscard]] constexpr T
pow(T exp) noexcept
64 static_assert(std::is_integral_v<T>,
"T must be an integral");
65 static_assert(Base > 0,
"Base must be greater than zero");
67 return exp <= T{0} ? T{1} : Base * pow<Base>(exp - T{1});
constexpr T num_digits(T value) noexcept
constexpr T pow(T exp) noexcept
constexpr T abs(T value) noexcept