Round-off error
In computing, a roundoff error, also called rounding error, is the difference between the result produced by a given algorithm using exact arithmetic and the result produced by the same algorithm using finite-precision, rounded arithmetic.[src] Rounding errors are due to inexactness in the representation of real numbers and the arithmetic operations done with them.[src] This is a form of quantization error.[src] When using approximation equations or algorithms, especially when using finitely many digits to represent real numbers (which in theory have infinitely many digits), one of the goals of numerical analysis is to estimate computation errors.[src] Computation errors, also called numerical errors, include both truncation errors and roundoff errors.[src] When a sequence of calculations with an input involving any roundoff error are made, errors may accumulate, sometimes dominating the calculation.[src] In ill-conditioned problems, significant error may accumulate.[src] In short, there are two major facets of roundoff errors involved in numerical calculations: # The ability of computers to represent both magnitude and precision of numbers is inherently limited.[src] # Certain numerical manipulations are highly sensitive to roundoff errors.[src] This can result from both mathematical considerations as well as from the way in which computers perform arithmetic operations.[src]
In computing, a roundoff error, also called rounding error, is the difference between the result produced by a given algorithm using exact arithmetic and the result produced by the same algorithm using finite-precision, rounded arithmetic.[src] Rounding errors are due to inexactness in the representation of real numbers and the arithmetic operations done with them.[src] This is a form of quantization error.[src] When using approximation equations or algorithms, especially when using finitely many digits to represent real numbers (which in theory have infinitely many digits), one of the goals of numerical analysis is to estimate computation errors.[src] Computation errors, also called numerical errors, include both truncation errors and roundoff errors.[src] When a sequence of calculations with an input involving any roundoff error are made, errors may accumulate, sometimes dominating the calculation.[src] In ill-conditioned problems, significant error may accumulate.[src] In short, there are two major facets of roundoff errors involved in numerical calculations: The ability of computers to represent both magnitude and precision of numbers is inherently limited.[src] Certain numerical manipulations are highly sensitive to roundoff errors.[src] This can result from both mathematical considerations as well as from the way in which computers perform arithmetic operations.[src] x = \pm (\underbrace{d_{0}.d_{1}d_{2}\ldots d_{p-1}}_\text{significand})_{\beta} \times \beta ^{\overbrace{E}^\text{exponent}} = \pm d_{0}\times \beta ^{E}+d_{1}\times \beta ^{E-1}+\ldots+ d_{p-1}\times \beta ^{E-(p-1)} where d_{i} is an integer such that 0 \leq d_{i} \leq \beta-1 for i = 0, 1, \ldots, p-1 , and E is an integer such that L \leq E \leq U .[src] The total number of normalized floating-point numbers is 2(\beta -1)\beta^{p-1} (U-L+1)+1, where 2 counts choice of sign, being positive or negative (\beta -1) counts choice of the leading digit \beta^{p-1} counts remaining significand digits U-L+1 counts choice of exponents 1 counts the case when the number is 0 .[src] In the IEEE standard the base is binary, i.e.[src] \beta = 2 , and normalization is used.[src] The IEEE standard stores the sign, exponent, and significand in separate fields of a floating point word, each of which has a fixed width (number of bits).[src] The two most commonly used levels of precision for floating-point numbers are single precision and double precision.[src] The machine epsilon, denoted \epsilon_\text{mach} , is the maximum possible absolute relative error in representing a nonzero real number, x in a floating-point number system.[src] \epsilon_\text{mach} = \max_{x} \frac The machine epsilon, denoted \epsilon_\text{mach} , is the smallest number \epsilon such that \operatorname{fl}(1+\epsilon) > 1 .[src] Thus, \operatorname{fl}(1+\delta)=\operatorname{fl}(1)=1 , whenever |\delta| Example: the decimal number (9.4)_{10}=(1001.{\overline{0110}})_{2} can be rearranged into +1.\underbrace{0010110011001100110011001100110011001100110011001100}_\text{52 bits}110 \ldots \times 2^{3} Since the 53rd bit to the right of the binary point is a 1 and is followed by other nonzero bits, the round-to-nearest rule requires rounding up, that is, add 1 bit to the 52nd bit.[src] Thus, the normalized floating-point representation in IEEE standard of 9.4 is \operatorname{fl}(9.4)=1.0010110011001100110011001100110011001100110011001101 \times 2^{3}.[src] Now, the roundoff error can be calculated when representing 9.4 with \operatorname{fl}(9.4) .[src] This representation is derived by discarding the infinite tail 0.{\overline{1100}} \times 2^{-52}\times 2^{3} = 0.{\overline{0110}} \times 2^{-51} \times 2^{3}=0.4 \times 2^{-48} from the right tail and then added 1 \times 2^{-52} \times 2^{3}=2^{-49} in the rounding step.[src] Then \operatorname{fl}(9.4) = 9.4-0.4 \times 2^{-48} + 2^{-49} = 9.4+(0.2)_{10} \times 2^{-49}.[src] Thus, the roundoff error is (0.2 \times 2^{-49})_{10} .[src] Round-by-chop: \epsilon_\text{mach} = \beta^{1-p} Round-to-nearest: \epsilon_\text{mach} = \frac{1}{2}\beta^{1-p} Let x=d_{0}.d_{1}d_{2} \ldots d_{p-1}d_{p} \ldots \times \beta^{n} \in \mathbb{R} where n \in [L, U] , and let \operatorname{fl}(x) be the floating-point representation of x .[src] Since round-by-chop is being used, it is \begin{align} \frac &= \frac \\ &= \frac \\ &= \frac \times \beta^{-p} \end{align} In order to determine the maximum of this quantity, there is a need to find the maximum of the numerator and the minimum of the denominator.[src] Since d_{0}\neq 0 (normalized system), the minimum value of the denominator is 1 .[src] The numerator is bounded above by (\beta-1).(\beta-1){\overline{(\beta-1)}}=\beta .[src] Thus, \frac \leq \frac{\beta}{1} \times \beta^{-p} = \beta^{1-p}.[src] Therefore, \epsilon=\beta^{1-p} for round-by-chop.[src] The proof for round-to-nearest is similar.[src] Note that the first definition of machine epsilon is not quite equivalent to the second definition when using the round-to-nearest rule but it is equivalent for round-by-chop.[src] 1.00\ldots 0 \times 2^{0} + 1.00\ldots 0 \times 2^{-53} &= 1.\underbrace{00\ldots 0}_\text{52 bits} \times 2^{0} + 0.\underbrace{00\ldots 0}_\text{52 bits}1 \times 2^{0}\\ &= 1.\underbrace{00\ldots 0}_\text{52 bits}1\times 2^{0}.[src] \end{align} This is saved as 1.\underbrace{00\ldots 0}_\text{52 bits}\times 2^{0} since round-to-nearest is used in IEEE standard.[src] Therefore, 1+2^{-53} is equal to 1 in IEEE double precision and the roundoff error is 2^{-53} .[src] This example shows that roundoff error can be introduced when adding a large number and a small number.[src] The shifting of the decimal points in the significands to make the exponents match causes the loss of some of the less significant digits.[src] The loss of precision may be described as absorption.[src] Note that the addition of two floating-point numbers can produce roundoff error when their sum is an order of magnitude greater than that of the larger of the two.[src] For example, consider a normalized floating-point number system with base 10 and precision 2 .[src] Then fl(62)=6.2 \times 10^{1} and fl(41) = 4.1 \times 10^{1} .[src] Note that 62+41=103 but fl(103)=1.0 \times 10^{2} .[src] There is a roundoff error of 103-fl(103)=3 .[src] This kind of error can occur alongside an absorption error in a single operation.[src] For example, consider a normalized floating-point number system with the base \beta=10 and the significand digits are at most 2 .[src] Then fl(77) = 7.7 \times 10^{1} and fl(88) = 8.8 \times 10^{1} .[src] Note that 77 \times 88=6776 but fl(6776) = 6.7 \times 10^{3} since there at most 2 significand digits.[src] The roundoff error would be 6776 - fl(6776) = 6776 - 6.7 \times 10^{3}=76 .[src] For example, if the normalized floating-point number system above is still being used, then 1/3=0.333 \ldots but fl(1/3)=fl(0.333 \ldots)=3.3 \times 10^{-1} .[src] So, the tail 0.333 \ldots - 3.3 \times 10^{-1}=0.00333 \ldots is cut off.[src] For example, subtracting 2^{-60} from 1 in IEEE double precision as follows, \begin{align} 1.00\ldots 0 \times 2^{0} - 1.00\ldots 0 \times 2^{-60} &= \underbrace{1.00\ldots 0}_\text{60 bits} \times 2^{0} - \underbrace{0.00\ldots 01}_\text{60 bits} \times 2^{0}\\ &= \underbrace{0.11\ldots 1}_\text{60 bits}\times 2^{0}.[src] \end{align} This is saved as \underbrace{1.00\ldots 0}_\text{53 bits}\times 2^{0} since round-to-nearest is used in IEEE standard.[src] Therefore, 1-2^{-60} is equal to 1 in IEEE double precision and the roundoff error is -2^{-60} .[src] The subtracting of two nearly equal numbers is called subtractive cancellation.[src] When the leading digits are cancelled, the result may be too small to be represented exactly and it will just be represented as 0 .[src] For example, let |\epsilon| and the second definition of machine epsilon is used here.[src] What is the solution to (1+\epsilon) - (1-\epsilon) ?[src] It is known that 1+\epsilon and 1-\epsilon are nearly equal numbers, and (1+\epsilon) - (1-\epsilon)=1+\epsilon-1+\epsilon=2\epsilon .[src] However, in the floating-point number system, fl((1+\epsilon) - (1-\epsilon))=fl(1+\epsilon)-fl(1-\epsilon)=1-1=0 .[src] Although 2\epsilon is easily big enough to be represented, both instances of \epsilon have been rounded away giving 0 .[src] Even with a somewhat larger \epsilon , the result is still significantly unreliable in typical cases.[src] There is not much faith in the accuracy of the value because the most uncertainty in any floating-point number is the digits on the far right.[src] For example, 1.99999 \times 10 ^{2}- 1.99998 \times 10^{2} = 0.00001\times10^{2} =1 \times 10^{-5}\times 10^{2}=1\times10^{-3} .[src] The result 1\times10^{-3} is clearly representable, but there is not much faith in it.[src] This is closely related to the phenomenon of catastrophic cancellation, in which the two numbers are known to be approximations.[src] An algorithm or numerical process is called stable if small changes in the input only produce small changes in the output, and unstable if large changes in the output are produced.[src] For example, the computation of f(x) = \sqrt{1 + x} - 1 using the "obvious" method is unstable near x = 0 due to the large error introduced in subtracting two similar quantities, whereas the equivalent expression \textstyle{f(x) = \frac{x}{\sqrt{1+x} + 1}} is stable.[src] ==References==[src]
78 sentences · 78 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Round-off error." encyclopegia.org, 2026, https://encyclopegia.org/wiki/round-off-error. Accessed 28 November 2026.
Chicago
"Round-off error." encyclopegia.org. Accessed November 28, 2026. https://encyclopegia.org/wiki/round-off-error.
APA
encyclopegia.org. (2026). Round-off error. Retrieved November 28, 2026, from https://encyclopegia.org/wiki/round-off-error
Accessed November 28, 2026 · CC BY-SA 4.0 · citation page · JSON