Floating-point arithmetic: Difference between revisions

Content deleted Content added
Internal representation: In the table, replaced "Type" by "Format" (types are for programming languages), and added the current standard names.
Tags: Mobile edit Mobile web edit Advanced mobile edit
Line 334:
The result of rounding differs from the true value by about 0.03 parts per million, and matches the decimal representation of π in the first 7 digits. The difference is the [[discretization error]] and is limited by the [[machine epsilon]].
 
The arithmetical difference between two consecutive representable floating-point numbers which have the same exponent is called a [[unit in the last place]] (ULP). For example, if there is no representable number lying between the representable numbers 1.45a70c2245A70C22<sub>hex16</sub> and 1.45a70c2445A70C24<sub>hex16</sub>, the ULP is 2×16<sup>−8</sup>, or 2<sup>−31</sup>. For numbers with a base-2 exponent part of 0, i.e. numbers with an absolute value higher than or equal to 1 but lower than 2, an ULP is exactly 2<sup>−23</sup> or about 10<sup>−7</sup> in single precision, and exactly 2<sup>−53</sup> or about 10<sup>−16</sup> in double precision. The mandated behavior of IEEE-compliant hardware is that the result be within one-half of a ULP.
 
=== Rounding modes ===