Theorem 11
When subtracting two floating-point numbers x - y
, we usually lose some precision, especially if x
and y
are very close. However, under certain conditions where x
and y
are close but not too close, a guard digit allows us to perform an exact subtraction - specifically, when:
Detecting subtraction errors
We can create a rudimentary mechanism for detecting subtraction errors by scaling up the values before we subtract them, then scaling down the difference by the same factor.
Proof
If