0
$\begingroup$

Consider the set of floating point numbers $\mathbb{F}_{10,3,100}$. That is, decimal numbers with $3$ significant digits and exponents between $-98$ and $99$.

What is the distance between $1230000$ and the closest floating point number $\ne 1230000$ in the set $\mathbb{F}_{10,3,100}$?

My current thought process:

The closest floating point number in the set is when the significant digits are, in order, $2, 3, 0$, and the exponent is $e = 6$. This is when $F = 10^6\cdot(1 + {2 \over 10} + {3 \over 10^2} + {0 \over 10^3})$

But that is exactly equal to $1230000$.

I could play with the significant digits, making it $F = 10^6\cdot(1 + {2 \over 10} + {3 \over 10^2} + {1 \over 10^3})$, but something seems amiss.

P.S. new to floating point arithmetics, anyone has any good resources?

  • 0
    Note that you only have normalized floating point formats for base 2, in base 10 the first digit can be different from 1.2017-02-08
  • 0
    Wouldn't that still produce exactly 1230000? i.e. $10^6 \cdot (1 + {2 \over 10} + {3 \over 10^2})$?2017-02-09
  • 0
    Yes, as 1230000 is exactly representable. It means that between 1220000, 1230000 and 1240000 there are no other representable numbers.2017-02-09

0 Answers 0