diff --git a/include/duckhandy/lexical_cast.hpp b/include/duckhandy/lexical_cast.hpp index a8d8e34..3ad1877 100644 --- a/include/duckhandy/lexical_cast.hpp +++ b/include/duckhandy/lexical_cast.hpp @@ -168,7 +168,7 @@ namespace dhandy { std::size_t dec::count_digits_implem (T parValue, dhandy::bt::index_seq, dhandy::bt::index_seq) { typedef typename std::make_unsigned::type UT; static constexpr UT powers[] = { 0, static_cast(dhandy::implem::power<10, Powers + 1>::value)... }; - static constexpr std::size_t maxdigits[] = { count_digits_bt(static_cast(sprout::pow(2.0, Digits))) - (std::numeric_limits::is_signed ? 1 : 0)... }; + static constexpr std::size_t maxdigits[] = { count_digits_bt(static_cast(sprout::pow(2.0, Digits))) - (std::numeric_limits::is_signed ? 1 : 0)... }; const auto bits = sizeof(parValue) * CHAR_BIT - dhandy::implem::count_leading_zeroes(dhandy::implem::abs(parValue)); static_assert(std::is_same::value, "Unexpected type"); return (dhandy::implem::abs(parValue) < powers[maxdigits[bits] - 1] ? maxdigits[bits] - 1 : maxdigits[bits]) + dhandy::implem::is_negative::check(parValue);