4#ifndef TETL_STRINGS_CONVERSION_HPP
5#define TETL_STRINGS_CONVERSION_HPP
7#include <etl/_algorithm/reverse.hpp>
8#include <etl/_concepts/integral.hpp>
9#include <etl/_cstddef/size_t.hpp>
10#include <etl/_math/abs.hpp>
11#include <etl/_math/idiv.hpp>
12#include <etl/_type_traits/is_signed.hpp>
46 bool isNegative =
false;
47 if constexpr (is_signed_v<Int>) {
55 auto const [quot, rem] =
etl::idiv(num,
static_cast<Int>(base));
56 auto const digit =
static_cast<
char>(
etl::abs(rem));
58 str[i++] = (digit > 9) ? (digit - 10) +
'a' : digit +
'0';
constexpr auto reverse(BidirIt first, BidirIt last) -> void
Reverses the order of the elements in the range [first, last).
Definition reverse.hpp:17
from_integer_error
Definition from_integer.hpp:20
constexpr auto from_integer(Int num, char *str, size_t length, int base) -> from_integer_result
Definition from_integer.hpp:31
Definition adjacent_find.hpp:9
Definition from_integer.hpp:16
bool terminate_with_null
Definition from_integer.hpp:17
Definition from_integer.hpp:25
char * end
Definition from_integer.hpp:26
from_integer_error error
Definition from_integer.hpp:27