If $1/2 ≤ p/q ≤ 2$ , then $p-q$ is representable exactly on the computer

30 Views Asked by At

I've found the following affirmation in an article. I've been thinking about it but I don't know the way to prove it:

It is not hard to prove that if $p$ and $q$ are two of a computer’s floating–point numbers, and if $$\frac{1}{2} \leq \frac{p}{q} \leq 2,$$ then $p - q$ is a floating-point number too, representable exactly in the computer, unless it underflows.

Why is this true?