Floating Point Arithmetic
Representation and error in floating-point computation
A normalized floating-point number has a sign, a significand, and an exponent. A finite significand means that most real numbers must be rounded to a nearby representable value. Machine precision describes the spacing of representable values near one, not a universal absolute error for every magnitude.
Rounding error is often expressed relatively: a stored value can differ from the mathematical value by a small fraction under a stated rounding rule. At very large magnitude the exponent range can overflow; at very small magnitude a result can underflow, perhaps becoming subnormal or zero depending on the system.
Subtraction deserves special care. When two nearly equal rounded numbers are subtracted, their leading digits cancel and the relative error in the small difference can become large.
In a basic matrix product, each multiplication and addition is rounded; changing the evaluation order or accumulating in a higher precision can reduce observed roundoff, while conditioning analysis and full algorithm-specific stability require separate tools.
In the same three-significant-digit, round-to-nearest decimal system, write the stored value for 0.003274.
Mark Yourself Question
- Grab a piece of paper and try this problem yourself.
- When you're done, check the "I have answered this question" box below.
- View the solution and report whether you got it right or wrong.
A calculation stores x = 91,300 and y = 91,100, each with an absolute rounding uncertainty of up to 50. It computes d = x - y. Give d and explain why its relative uncertainty is much larger than the relative uncertainty of x or y.