Math 2.0

Numerical analysis Definition

Floating-point arithmetic

Builds on RoundingIntegers

Definition

Fix integers β≥2\beta \ge 2 (the base), p≥1p \ge 1 (the precision), and emin⁡<emax⁡e_{\min} < e_{\max}. A floating-point number of this system is 00 or a real number of the form x=± (d0.d1d2…dp−1)β×βe=±(∑i=0p−1diβ−i)βe.x = \pm\, (d_0 . d_1 d_2 \ldots d_{p-1})_\beta \times \beta^{e} = \pm \left( \sum_{i=0}^{p-1} d_i \beta^{-i} \right) \beta^{e}. Here the digits did_i are integers with 0≤di≤β−10 \le d_i \le \beta - 1, and the exponent ee is an integer with emin⁡≤e≤emax⁡e_{\min} \le e \le e_{\max}. The number is normalized if d0≠0d_0 \ne 0. Let FF be the set of these numbers. Let fl\mathrm{fl} be a rounding to FF of the real numbers between min⁡F\min F and max⁡F\max F, usually rounding to nearest. Floating-point arithmetic replaces each operation ∘∈{+,−,×,/}\circ \in \set{+, -, \times, /} on x,y∈Fx, y \in F, whenever x∘yx \circ y lies in this range, by x⊛y=fl(x∘y),x \circledast y = \mathrm{fl}(x \circ y), that is, the exact result rounded to FF.

Remarks

Example: with β=10\beta = 10 and p=3p = 3, the numbers x=1.23x = 1.23 and y=4.56×10−2y = 4.56 \times 10^{-2} lie in FF, and x⊕y=fl(1.2756)=1.28x \oplus y = \mathrm{fl}(1.2756) = 1.28 under rounding to nearest. Non-example: with β=10\beta = 10 and p=3p = 3, the number 1.2341.234 is not in FF, since it needs four significant digits. Floating-point addition is commutative but not associative: with β=10\beta = 10 and p=3p = 3, (1.00⊕0.004)⊕0.004=1.00(1.00 \oplus 0.004) \oplus 0.004 = 1.00, while 1.00⊕(0.004⊕0.004)=1.011.00 \oplus (0.004 \oplus 0.004) = 1.01. In the range of normalized numbers and with rounding to nearest, x⊛y=(x∘y)(1+δ)x \circledast y = (x \circ y)(1 + \delta) with ∣δ∣≤12β1−p\abs{\delta} \le \tfrac12 \beta^{1-p}.

Reading path

To understand this page from the ground up, read these 3 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Integers object
  2. Rounding concept
  3. Floating-point arithmetic definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Floating-point_arithmetic
About this page
TagR8S821AD6T
URIm2://R8S821AD6T
Kinddefinition
WritingW0 stub
MSC65G50, 65Y04
DefinesFloating-point arithmetic
UsesRounding, Integers

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.