1
$\begingroup$

I'm writing some code, and I'm trying to succintly explain that $0.1$ has infinitely many repeating decimals in base 2 ($0.0\overline{0011}_2$).

How can I succintly explain this to a programmer, in a source code comment, without using $\LaTeX$ or too advanced UTF-8 symbols? Does it have a name?

$\endgroup$
  • $\begingroup$ non-terminating. $\endgroup$ – symplectomorphic Jan 3 '17 at 22:56
  • $\begingroup$ This only answers your second question; however, the following link may be of use. It's called a repeating decimal. (Who knew! :)) Even though you're using base 2, I suppose the decimal is for "decimal point". $\endgroup$ – Fine Man Jan 3 '17 at 22:56
3
$\begingroup$

I would say "$0.1$ is non-terminating in base $2$". "A repeating decimal" would also be an appropriate phrase to use in place of "non-terminating".

If you're trying to demonstrate that it's non-terminating, I can't suggest anything better than just saying "$0.1$ is '$0.000110011\ldots$' in base $2$". I'd recommend not trying to explain any further in comments; if they don't understand what "non-terminating" means, they can look it up.

$\endgroup$
1
$\begingroup$

In your example, you would say that $0.1_{10}$ is not a binary fraction, meaning that it cannot be expressed as a fraction with a denominator that is a power of $2$.

For example, $0.75_{10}$ can be expressed as $\frac{3}{2^2}$, so it is a binary fraction.

This terminology can be easily extended to other numbering systems (i.e. "decimal fraction", "octal fraction", or "hexadecimal fraction")

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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