
<snip>
* Why cpp_dec_float doesn't have a template parameter to give the integral digits? or as the C++ standard proposal from Lawrence Crow (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3352.html), take the range and resolution as template parameters?
I don't understand, how is that different from the number of decimal digits? Oh I got it now. the decimal digits concern the mantissa and not the digits of the fractional part?
<snip>
Best, Vicente
Actually, I believe there might be a subtle difference. Crow's paper describes fixed-point types. In my opinion, a fixed-point number is a specialized real data type, optionally signed, that has a fixed number of digits before the decimal point and another fixed number of digits after the decimal point. The cpp_dec_float back-end, however, more closely emulates a floating-point type rather than a fixed-point type---even though the internal storage and manipulation mechanisms are quite similar for both. So, in fact, the number of decimal digits of precision of a cpp_dec_float is for the *whole thing* including both mantissa and fraction. There is also an exponent field. But this does not count in the precision. So when you create the cpp_dec_float_50 representation of (1 / 3), you get 50 total digits of precision. In this case, this means that there are 50 individual three's after the decimal point (plus so-called *guard* digits if you really dig deep into it). For example, using boost::multiprecision::cpp_dec_float_50; // 0.33333 33333 33333 33333 33333 33333 33333 33333 33333 33333 const cpp_dec_float_50 third(cpp_dec_float_50(1) / 3); Thanks for your comments. Best regards, Chris.