ExactBench · Engineering calculators

IEEE 754 Converter

IEEE 754-2019 · Half / Single / Double

Value

Bit pattern

0x3DCCCCCD
exact value 0.100000001490116119384765625

Field layout

normal
SINGLE (32-BIT) · 32 BITSSIGN0EXPONENT (8)01111011MANTISSA (23)10011001100110011001101310
Hex bit pattern0x3DCCCCCD
Exact stored value0.100000001490116119384765625
Error from input1.49012e-9
Sign · exponent · mantissa0 01111011 10011001100110011001101
Unbiased exponent-4 (stored 123 − bias 127)
Significand13421773
ULP at this magnitude7.45058e-9
ClassificationNormal · Single (32-bit)
How this works. A float stores (−1)sign × 1.mantissa × 2exponent−bias. The leading 1 is implied rather than stored, which buys one extra bit of precision — except for subnormals, where the exponent field is zero and the leading digit is 0 instead. Because the mantissa is binary, most decimal fractions cannot be represented at all: 0.1 is stored as the nearest available binary fraction, which is why Exact stored value above is not 0.1. That difference is the entire reason 0.1 + 0.2 !== 0.3. Rounding here is round-half-to-even, as the standard specifies, and the error is computed as an exact rational difference rather than in floating point.
This value is subnormal, infinite or NaN — precision is reduced or absent, and arithmetic on it may not behave as you expect.

Values worth knowing

0.1 as single0x3DCCCCCDExactly 0.100000001490116119384765625
0.1 as double0x3FB999999999999AExactly 0.1000000000000000055511151231257827…
0.2 as double0x3FC999999999999AAdd it to 0.1 and you do not get 0.3
1.0 as single0x3F800000Exponent 127, mantissa zero
Largest finite single0x7F7FFFFF≈ 3.4028235 × 10³⁸
Smallest normal single0x00800000≈ 1.1754944 × 10⁻³⁸
Smallest subnormal single0x00000001≈ 1.4 × 10⁻⁴⁵, with one bit of precision left
Positive infinity0x7F800000Exponent all ones, mantissa zero
Quiet NaN0x7FC00000Exponent all ones, mantissa non-zero
Negative zero0x80000000Equals +0 in comparison, differs in bits

Every one of these is exact, not rounded for display — the decimals above are the complete value stored in the bits. That 0.1 and 0.2 are each slightly above their decimal value is precisely why their sum misses 0.3.