7 #if !defined(CNL_IMPL_WIDE_INTEGER_NUMERIC_LIMITS_H)
8 #define CNL_IMPL_WIDE_INTEGER_NUMERIC_LIMITS_H
10 #include "../duplex_integer.h"
11 #include "../limits/lowest.h"
12 #include "../num_traits/rep_of.h"
13 #include "definition.h"
23 template<
int Digits,
typename Narrowest>
25 : numeric_limits<cnl::_impl::rep_of_t<cnl::wide_integer<Digits, Narrowest>>> {
29 using rep = cnl::_impl::rep_of_t<value_type>;
30 using rep_numeric_limits = numeric_limits<rep>;
31 static_assert(rep_numeric_limits::is_integer);
35 static constexpr
int digits = Digits;
37 [[nodiscard]]
static constexpr
auto min() noexcept
42 [[nodiscard]]
static constexpr
auto max() noexcept
45 rep_numeric_limits::max() >> (rep_numeric_limits::digits - digits)};
48 [[nodiscard]]
static constexpr
auto lowest() noexcept
51 rep_numeric_limits::lowest() >> (rep_numeric_limits::digits - digits)};
55 template<
int Digits,
typename Narrowest>
57 : numeric_limits<cnl::wide_integer<Digits, Narrowest>> {
58 static constexpr
bool is_integer =
true;
62 #endif // CNL_IMPL_WIDE_INTEGER_NUMERIC_LIMITS_H