Math 2.0

Numerical analysis Definition

Rounding

Builds on Floor functionIntegers

Definition

Let F⊆ℝF \subseteq \R be unbounded above and below, with only finitely many elements in each bounded interval. An example is the set ℤ\Z of integers. For x∈ℝx \in \R let x−=max⁡{f∈F:f≤x}x^- = \max \set{f \in F : f \le x} and x+=min⁡{f∈F:f≥x}x^+ = \min \set{f \in F : f \ge x}. A rounding to FF is a map rd ⁣:ℝ→F\mathrm{rd} \colon \R \to F with rd(x)∈{x−,x+}\mathrm{rd}(x) \in \set{x^-, x^+} for every xx. The standard roundings are:

  1. rounding down: rd(x)=x−\mathrm{rd}(x) = x^-;
  2. rounding up: rd(x)=x+\mathrm{rd}(x) = x^+;
  3. rounding toward zero: rd(x)=x−\mathrm{rd}(x) = x^- if x≥0x \ge 0 and x+x^+ if x<0x < 0;
  4. rounding to nearest: rd(x)\mathrm{rd}(x) is the element of {x−,x+}\set{x^-, x^+} closest to xx. When xx is exactly halfway, a tie rule decides, such as ties to even or ties away from zero.

Remarks

Example: for F=ℤF = \Z, rounding down is the floor function, rounding up is the ceiling function, and rounding to nearest with ties to even sends 2.5↦22.5 \mapsto 2, 3.5↦43.5 \mapsto 4 and 2.7↦32.7 \mapsto 3. Check for 2.72.7: x−=2x^- = 2, x+=3x^+ = 3, and ∣2.7−3∣=0.3<0.7=∣2.7−2∣\abs{2.7 - 3} = 0.3 < 0.7 = \abs{2.7 - 2}. Non-example: the map x↦⌊x⌋−1x \mapsto \floor{x} - 1 is not a rounding to ℤ\Z, since ⌊2.7⌋−1=1∉{2,3}\floor{2.7} - 1 = 1 \notin \set{2, 3}. Each of the four standard roundings is monotone: x≤yx \le y implies rd(x)≤rd(y)\mathrm{rd}(x) \le \mathrm{rd}(y). An arbitrary rounding need not be monotone, since it may choose x+x^+ for one point and x−x^- for a larger point of the same gap. For floating-point numbers, FF is extended by the subnormal numbers and by ±∞\pm \infty to cover overflow.

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. Floor function concept
  2. Integers object
  3. Rounding definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Rounding
About this page
TagN6AFVYBY2Z
URIm2://N6AFVYBY2Z
Kinddefinition
WritingW0 stub
MSC65G50, 65Y04
DefinesRounding
UsesFloor function, 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.