In C, `DBL_MANT_DIG` gives the precision of `double`: the number of binary digits used for its floating-point significand. It is typically 53. Precision describes a representation, not the accuracy of a particular calculation. section 5.7.8 section 5.8
In a simplified model, a floating-point value has a sign `s`, an exponent `e`, and `p` mantissa bits `f₁` through `fₚ`. Its value is `s × 2ᵉ × Σ(fₖ × 2⁻ᵏ)`. The exponent controls scale; `p` limits how many binary digits the representation retains. Both precision and exponent limits depend on the type. section 5.7.8
Three mantissa bits
Take `s = −1`, `e = −2`, and mantissa bits `101`. Their fractional value is `1/2 + 1/8 = 5/8`, so the represented value is `−2⁻² × 5/8 = −5/32`. A finite set of bits cannot retain every binary expansion; digits may be cut off, including during intermediate computations. section 5.7.8
Precision also has an integer meaning. For an unsigned type with precision `p`, bits `b₀` through `bₚ₋₁` represent `Σ(bᵢ × 2ⁱ)`. Its values therefore run from `0` through `2ᵖ − 1`; for unsigned types, precision equals width. Unlike an integer result without overflow, a floating-point result may be approximate. section 5.7.1 section 5.8
TAKEAWAY: Use the relevant type’s precision when reasoning about its limits.
- Do not assume C prescribes one precision for every implementation of a basic type. section 5.2
- For shifts, keep the right operand below the precision; bits shifted beyond an unsigned representation are dropped. section 5.7.3
- For bit-set complement, the precision determines which bit positions belong to the complemented set. section 5.7.2








