Decimal floating point

This wider range can dramatically slow the accumulation of rounding errors during successive calculations; for example, the Kahan summation algorithm can be used in floating point to add many numbers with no asymptotic accumulation of rounding error.

In the case of the mechanical calculators, the exponent is often treated as side information that is accounted for separately.

This was subsequently addressed in IEEE 754-2008, which standardized the encoding of decimal floating-point data, albeit with two different alternative methods.

Like the binary floating-point formats, the number is divided into a sign, an exponent, and a significand.

Unlike binary floating-point, numbers are not necessarily normalized; values with few significant digits have multiple possible representations: 1×102=0.1×103=0.01×104, etc.

While the encoding can represent larger significands, they are illegal and the standard requires implementations to treat them as 0, if encountered on input.

Note that the leading bits of the significand field do not encode the most significant decimal digit; they are simply part of a larger pure-binary number.

In the above cases, the value represented is: Decimal64 and Decimal128 operate analogously, but with larger exponent continuation and significand fields.

The leading digit is between 0 and 9 (3 or 4 binary bits), and the rest of the significand uses the densely packed decimal (DPD) encoding.

Finally, the significand continuation field made of 2, 5, or 11 10-bit declets, each encoding 3 decimal digits.

We proceed with the usual addition method: The following example is decimal, which simply means the base is 10.

Dealing with the consequences of these errors is a topic in numerical analysis; see also Accuracy problems.

There are no cancellation or absorption problems with multiplication or division, though small errors may accumulate as operations are performed repeatedly.