Ok, I have debugged into the library, and the "error" happens on this line:
// Check if the operation is out of range, requiring special handling.
if(v.iszero() || (ofs_exp > max_delta_exp))
{
// Result is *this unchanged since v is negligible compared to *this.
return *this;
}
Adding 1 to the numeric_limit of the type is negligible, so the addition is discarded. Hence it is not >=.
I was under the impression that the type was implemented as fixed point (dumb considering the name, I know), which it is not. This is from the boost doc
Operations involving cpp_dec_float are always truncating. However, note that since their are guard digits in effect, in practice this has no real impact on accuracy for most use cases.
Bummer that the multiprecision library doesn't seem to have a fixed precision type.
However, in order to check for overflow in cpp_dec_float, one can do this:
dtNew = _1 * _2;
if(dtNew.backend().isinf())
{
BOOST_THROW_EXCEPTION(OverUnderflow() << SpecificErrInfo(L"Attempted floating point over/underflow"));
}