Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let $\mathbb G(q,l)$ to be the set of all floating-point numbers in the base $q$ and with a mantissa of a length $l$. In the lecture notes I am trying to learn from, the following is said to be obvious (and consequently has no proof):

$$ \forall x \in \mathbb G(q,l), \forall y \in \mathbb G(q,l)\setminus\{x\}: |x-y| \ge |x|q^{-l} $$

What I have tried so far:

Let $x=(-1)^m a \cdot q^\alpha$ and $y=(-1)^n b \cdot q^\beta \in \mathbb G(q,l)$ such that $x \ne y$, then

\begin{align} |x-y| &\ge |x|-|y| \\ &=|(-1)^m a \cdot q^\alpha|-|(-1)^n b \cdot q^\beta| \\ &=a \cdot q^\alpha - b \cdot q^\beta \\ &\ge ...? \end{align}

share|cite|improve this question
It's certainly not true if $y=x$. Presumably they mean $y \ne x$. – Robert Israel Dec 24 '12 at 0:24
The first line $|x-y|\geq |x|+|y|$ is incorrect. The inequality goes the other way. – Alex Becker Dec 24 '12 at 0:30
Thank you, Robert and Alex, I've fixed the above-mentioned. – Leo Dec 24 '12 at 0:35
up vote 2 down vote accepted

Since it's true for $x=0$, we may assume $x \ne 0$. By symmetry, assume $x > 0$. Let $x = a \cdot q^\beta$ with $a$ an integer, $q^{\ell-1} \le a \le q^{\ell} - 1$. Let $y_1$ and $y_2$ be the greatest floating-point number $< x$ and the least floating-point number $>x$ respectively. If $q^{\ell-1} < a$, then $y_1 = (a-1) \cdot q^\beta$ and $|x - y_1| = q^\beta$ while $x q^{-\ell} = a \cdot q^{\beta - \ell} < q^{\beta}$. Similarly, if $a < q^{\ell}-1$, $|x - y_2| = q^\beta$. I'll leave it to you to try $|x - y_1|$ with $a = q^{\ell-1}$ and $|x - y_2|$ with $a = q^{\ell}-1$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.