If a quadrature error bound is and the relevant numerical resolution is , equating these scales gives an estimate of the strip count beyond which that truncation guarantee reaches the rounding scale. For the composite Simpson's rule, . This estimate is useful for choosing a sensible order of magnitude, but a worst-case bound need not equal the actual quadrature error.
For a normal floating-point number in base two, the spacing depends on the exponent of the result; half the spacing is a natural final-storage rounding scale. Machine epsilon instead measures the gap above one. Function-evaluation errors, accumulation of summation error, cancellation, and the arithmetic used for the nodes can impose an earlier practical accuracy limit. Thus final storage precision alone cannot give a universal optimal strip count.
Bit-plane slicing 2026-11-05
Bit-plane slicing extracts the same bit position from every integer sample of a digital image, producing one binary image per bit plane. For an unsigned -bit sample and ,
Equivalently, bitwise AND with the mask isolates that position, and a bit shift or nonzero test converts it to zero or one. Linux's frame-buffer API describes the underlying bit-plane storage convention as plane carrying bit of every sample.[ref]
For an original four-bit sample , the binary digits are : the planes have . Their contributions reconstruct . Displaying each plane as a black-and-white image makes its pattern visible, but does not give every plane equal numerical significance.
Figure 1.
An original four-bit image, two extracted bit planes and reconstruction from the two most significant planes
. Every grid entry shows its integer value. The binary panels map zero to black and one to white; the input and reconstruction use the common zero-to15 grayscale. The alternating row pattern is visible in the least significant plane. Details.
Keeping only planes three and two gives . The discarded remainder satisfies , by integer division. A one-unit change from seven to eight nevertheless flips every one of the four bits, so the binary patterns need not vary smoothly as intensity codes change. Nor is a low bit plane automatically noise: it can encode a deliberately structured pattern, as the example shows.
Slicing is an operation on the stated integer encoding. Applying it to a floating-point number's stored bit pattern examines sign, exponent and fraction fields rather than the same unsigned intensity significance. The sample type and pixel format therefore belong in the definition of the operation.
Floating-point addition 2026-10-31
To add two finite floating-point numbers, compare their exponents, shift the smaller significand to a common exponent, add or subtract the signed significands, normalize the result, and apply floating-point rounding. Extra low-order bits are needed to determine correct rounding when shifting or cancellation discards information. A carry beyond the leading digit increases the exponent; cancellation can decrease it. Unlike exact real addition, this operation need not be associative. Changing the child evaluation order in a fixed binary expression tree need not change its parenthesization, whereas reassociation changes which intermediate results undergo floating-point rounding.
Floating-point number Created 2026-10-20 Updated 2026-11-05
A finite floating-point number is a value representable in a specified floating-point representation. For fixed precision and exponent bounds, only finitely many real values are available. Most real numbers therefore require rounding before storage.
In binary arithmetic, is exact but is not: a finite binary fraction has a reduced denominator that is a power of two. This is a property of the representation, even before any arithmetic operation occurs. The associated IEEE encodings additionally include infinities and NaN; NaN is a special arithmetic datum rather than a real value.[ref]
Floating-point overflow 2026-10-25
Floating-point overflow occurs when the magnitude of a computed result exceeds the largest finite representable floating-point number. Large values of an exponential function are a common source. In a normalized weighted sum, replacing exponentials by before division prevents this particular overflow while leaving the normalized weights unchanged; this is an application of the log-sum-exp construction.
Floating-point rounding 2026-10-25
Replacement of an exact real arithmetic result by a representable floating-point number under a specified rounding rule. Repeated products can depend on evaluation order, so a recursive rewrite intended to reproduce a floating-point loop should preserve its sequence of accumulator operations. An exact algebraic invariant does not by itself establish equality of rounded machine results.
Three advantages of integer arithmetic for raster graphics are:
These are historical and structural advantages, not a claim that every modern processor executes every integer operation faster. An integer implementation still needs sufficient width for its intermediate results. The compact answer is
Extend the data linked list node type by a real number field and compare that field through an Oberon type guard.
TYPE RealNode = RECORD (Node) value: REAL END;
     RealTail = POINTER TO RealNode;

PROCEDURE RealLess(p, q: Tail): BOOLEAN;
BEGIN
  RETURN p(RealTail).value < q(RealTail).value
END RealLess;
Construct the data chain from RealTail nodes, retain the ordinary Header for its header, set its count correctly, and call
MergeSort(RealLess, p)
Only data nodes reach RealLess, so the header needs no real-valued field. Its precondition is that every data node has the RealNode extension. With ordinary real numbers, the comparison supplies a total order; machine values such as NaN must be excluded if the machine floating-point number type admits them.
With the gap-at-one convention, machine epsilon is the difference between and the next larger representable floating-point number. The double-precision floating-point format has 53 significant binary digits, including the implicit leading digit, so
A related convention uses unit roundoff, the worst relative rounding scale for round-to-nearest: . Stating the convention distinguishes these two common values.[ref]
Let the committed model be amounts and an exchange rate , with invariant . Editing pounds keeps the rate and computes euros; editing euros keeps the rate and computes pounds; editing the rate keeps pounds and computes euros. A usable rate must be strictly positive, and every accepted floating-point number and derived result must be finite. Negative amounts are allowed. Rejecting invalid text preserves the last committed model.
Insert the following members inside the supplied MainFrame, after the three fields have been initialized. Its existing layout can remain as written:
private var p = 10.0
private var e = 11.5
private var r = 1.15
private var refreshing = false

private def finite(x: Double): Boolean = !x.isNaN && !x.isInfinity

private def showModel(): Unit = {
  refreshing = true
  try {
    pounds.text = java.lang.String.format(java.util.Locale.ROOT, "%.2f", Double.box(p))
    euros.text = java.lang.String.format(java.util.Locale.ROOT, "%.2f", Double.box(e))
    rate.text = r.toString
  } finally {
    refreshing = false
  }
}

private def edit(source: TextField): Unit = {
  try {
    val v = source.text.trim.toDouble
    if (finite(v)) {
      var nextP = p
      var nextE = e
      var nextR = r
      if (source eq pounds) {
        nextP = v
        nextE = v * r
      } else if (source eq euros) {
        nextE = v
        nextP = v / r
      } else if (source eq rate) {
        nextR = v
        nextE = p * v
      }
      if (nextR > 0.0 && finite(nextP) && finite(nextE) && finite(nextR)) {
        p = nextP
        e = nextE
        r = nextR
      }
    }
  } catch {
    case _: NumberFormatException => ()
  }
  showModel()
}

listenTo(pounds, euros, rate)
reactions += {
  case EditDone(source) if !refreshing => edit(source)
}
The invariant is interpreted with the usual floating-point rounding in multiplication and division. All candidate values are calculated before committing any of them, so invalid text, zero/negative rates, NaN, infinity and floating-point overflow leave the old model intact. The committed r remains positive, so euro-to-pound division is defined. Using a fixed formatting locale keeps the decimal separator compatible with toDouble. The displayed amounts are rounded to two decimal places, while the model retains their full available precision. The rate is not forcibly rounded to two places, which could otherwise turn a valid small positive rate into displayed zero.
The refreshing guard prevents synchronous derived-field notifications from recursively committing another edit. EditDone is an edit-completion event, not a request to react to every partial keystroke; pressing the field's completion action is enough to trigger the conversion. If a particular UI additionally needs live updates, it can subscribe to the appropriate text-change events with the same validation and authoritative-source policy. The supplied API and archived Scala Swing documentation suffice for the requested completion-event implementation; no unidentified practical library is required.[ref]
Use the standard spacing convention for machine epsilon: the next representable floating-point number above is . In a normalized binary representation this corresponds to significant binary digits, including the leading digit. The spacing throughout is therefore .
With rounding to nearest, the associated unit roundoff is half that spacing, ; for a normal result the relative round-off error is bounded by . Some texts instead call machine epsilon. Here denotes the spacing scale, and the iteration counts below use that convention. It describes representation precision, not a guarantee that an arbitrarily evaluated function has a relative error this small.
At a root of size between and , the spacing of floating-point numbers is . With ordinary stable function evaluations, a sensible generic absolute position tolerance has scale ; sub-spacing progress cannot generally be represented. This is a resolution estimate, not a lower bound excluding an accidentally exactly representable root.
Define one bisection method step as replacing the current bracket by the half retaining the sign change. Starting from , the width after such updates is . Therefore
The midpoint of a bracket has an exact-arithmetic error bound of half its width. If tolerance is defined instead as that midpoint error bound, updates suffice to make it at most . Stating the convention avoids an off-by-one difference; once the endpoints are adjacent floating-point numbers, their exact midpoint need not itself be representable.
Choose (iii), . Here the root has magnitude between and . Machine epsilon measures relative precision near unity; the spacing of representable floating-point numbers near the root is therefore of order . A step tolerance scaled to that magnitude is consistent with the attainable absolute positional accuracy. For IEEE binary64, using , , comparable to the local spacing. A fixed numerical constant cannot promise an exact correctly rounded root, but this is the most sensible of the three proposals.
Condition (ii) asks for a step below , a scale appropriate near one rather than near this root. A nonzero representable change near the root is normally much larger. The test may trigger only after exact stagnation, and rounding-induced oscillation can prevent that; it asks for unnecessarily fine absolute resolution.
Condition (i) measures a residual, not a position error. It changes if the same root problem is multiplied by a constant. Moreover, evaluating can involve cancellation among quantities of order , so an absolute residual of order need not be meaningful or attainable. Here , making residual and position errors comparable in exact arithmetic, but their requested absolute scale is still too small. A practical scale-aware stopping criterion for Newton iteration should also detect stagnation or a cycle rather than assuming exact arithmetic persists indefinitely.
Near a well-conditioned simple root, a numerically stable Newton root-finding iteration cannot usually resolve steps far below the local spacing of floating-point numbers. That spacing has relative scale comparable to machine epsilon , motivating the displayed position-based criterion with a modest constant . It combines an absolute scale near zero with a relative scale for large inputs. A residual-only test is changed by rescaling the equation, whereas the root and exact Newton step are unchanged. A tiny step alone is not a universal accuracy certificate: derivative errors, stagnation and cycles require separate consideration.