8 static const uint32_t
DIGITS = 256;
16 const uint64_t d = u % 10 +
'0';
17 *--s =
static_cast<char> (d);
26 char *
const s_end = s +
DIGITS;
31 fprintf (stderr,
"unsigned: expected: %lu, got: %u\n", i, u);
40 char *
const s_end = s +
DIGITS;
41 const uint64_t i_abs = i < 0
42 ?
static_cast<uint64_t
> (-i)
43 : static_cast<uint64_t> (i);
52 fprintf (stderr,
"signed: expected: %ld, got: %d\n", i, j);
62 static const uint64_t UDELTA = 0xFFFF;
64 for (uint64_t i = 0; i <= UDELTA; ++i)
69 static const uint64_t u32_max = std::numeric_limits<uint32_t>::max();
70 for (uint64_t i = u32_max - UDELTA; i <= u32_max + UDELTA; ++i)
75 static const int64_t IDELTA = 0xFFFF;
77 static const int64_t i32_min = std::numeric_limits<int32_t>::min();
78 for (int64_t i = i32_min - IDELTA; i <= i32_min + IDELTA; ++i)
83 for (int64_t i = -IDELTA; i <= IDELTA; ++i)
88 static const int64_t i32_max = std::numeric_limits<int32_t>::max();
89 for (int64_t i = i32_max - IDELTA; i <= i32_max + IDELTA; ++i)
static int32_t test_i(int64_t i)
static const uint32_t DIGITS
static int32_t test_u(uint64_t i)
bool s_to_u32_unsafe(const char *s, const char *s_end, uint32_t &number)
static char * u64_to_s_fastest_ever(uint64_t u, char *s)
bool s_to_i32_unsafe(const char *s, const char *s_end, int32_t &number)