37 return (N == 0) ? 0 : (N % 10) + (2 *
binary_func(N/10));
45template <
unsigned long N>
55 static unsigned const value = 0;
88 for (
size_t i = 0; i <
sizeof(run) /
sizeof(*run); ++i) {
89 printf(
"Should be %u: %u\n", run[i].expected, run[i].got);
constexpr struct anonymous_namespace{chapter-1.cpp}::@0 run[]
the container for test input and output.
constexpr uint32_t binary_func(uint64_t const N)
A runtime binary to decimal number translation.
the container for test input and output.
Prepend higher bits to lowest bit.
static unsigned const value