Selecting decimal output precision #
IEEE 754 §5.12.2 distinguishes preserving the source quantum from requesting a
number of significant digits. Precision makes this choice explicit. Requested
precision has no format-width cap: the coefficient is rounded once on the
requested decimal grid, and extra requested digits are supplied by exact zeros.
The text exponent is an unbounded integer, so output has no exponent overflow.
Zero at precision p is written with quantum 1-p. Special values keep their
exact spellings and fields. Only inexact can be raised during finite output.
Preserving the original quantum and requesting a digit count are separate operations.
Instances For
Correctly rounded significant-digit output, with an unbounded requested precision.
Instances For
Instances For
Format a datum either exactly or to a requested significant-digit count. The inexact flag records numerical rounding, rather than a change of quantum.