#include <asmgrader/common/aliases.hpp>
#include <boost/mp11/algorithm.hpp>
#include <boost/mp11/detail/mp_list.hpp>
#include <boost/mp11/integral.hpp>
#include <bit>
#include <cmath>
#include <concepts>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <type_traits>
Go to the source code of this file.
|
template<typename IntType > |
constexpr std::size_t | asmgrader::digits10_max_count = std::numeric_limits<std::decay_t<IntType>>::digits10 + 1 |
| This was a little confusing (to me at least) digits10 => maximum number of base-10 digits that can be represented with IntType below is a definition for the inverse of that i.e. => maximmum number of base-10 digits that IntType can represent For both signed and unsigned integer types, the value that produces the maximal amount of base10 digits will never itself be a power of 10. The proof for this is trivial using parity to check when all bits are set [2^(n+1) - 1] and factorization to check 2^n (for the negative complement of signed min).
|
|