diff --git a/include/boost/multiprecision/cpp_int.hpp b/include/boost/multiprecision/cpp_int.hpp index f60545df8..516d1f3ae 100644 --- a/include/boost/multiprecision/cpp_int.hpp +++ b/include/boost/multiprecision/cpp_int.hpp @@ -207,9 +207,9 @@ struct cpp_int_base(0u)); BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = static_cast(1u) << (limb_bits - 1)); BOOST_STATIC_CONSTANT(unsigned, internal_limb_count = - MinBits - ? (MinBits / limb_bits + ((MinBits % limb_bits) ? 1 : 0)) - : (sizeof(limb_data) / sizeof(limb_type))); + MinBits + ? (MinBits / limb_bits + ((MinBits % limb_bits) ? 1 : 0)) + : (sizeof(limb_data) / sizeof(limb_type)) > 1 ? (sizeof(limb_data) / sizeof(limb_type)) : 2); BOOST_STATIC_CONSTANT(bool, variable = true); private: