Computers store numbers in base 2. Whole numbers convert easily, but fractions hold a surprise that explains why a computer cannot store $0.1$ exactly. The story is the same one you met with Repeating Decimals as Fractions, told in base 2, and it is the first step toward measuring the errors a computer makes.
After the binary point, the places are worth $\frac{1}{2}, \frac{1}{4}, \frac{1}{8}, \frac{1}{16}, \ldots$ So $0.101_2 = \frac{1}{2} + \frac{1}{8} = 0.625$.
🔑 Key idea
To write a fraction $0 \le x < 1$ in base 2, double it: the whole-number part (0 or 1) is the next binary digit; keep the fraction part and repeat. A fraction in lowest terms ends in base 2 exactly when its denominator is a power of 2; otherwise its digits repeat forever.
💡 Why it works
If $x = 0.b_1b_2b_3\ldots_2$, then $2x = b_1.b_2b_3\ldots_2$: doubling moves the binary point one place right, so the whole part of $2x$ is $b_1$ and the fraction part holds the remaining digits. For $x = \frac{a}{n}$, every fraction part that appears has the form $\frac{r}{n}$ with $0 \le r < n$. There are only $n$ choices, so either some step gives $0$ (the expansion ends) or a fraction part comes back and the digits repeat from there. Ending means $x = \frac{k}{2^{j}}$, so in lowest terms the denominator must divide a power of 2.
We are back at $0.2$, so the digits $0011$ repeat forever: $$0.1 = 0.0\overline{0011}_2 = 0.000110011001\ldots_2$$
Why: $0.1 = \frac{1}{10}$, and $10 = 2 \times 5$ has the factor $5$.
Answer: $0.0\overline{0011}_2$
Repeated doubling of 0.1. The highlighted rows hold the same fraction, so the digits between them repeat forever.
✏️ Worked example: From repeating binary back to a fraction
Write $y = 0.\overline{01}_2 = 0.010101\ldots_2$ as a fraction.
Multiplying by $2^{2} = 4$ shifts the point two places: $4y = 1.\overline{01}_2$.
Subtract: $4y - y = 1$, so $3y = 1$ and $y = \frac{1}{3}$.
Answer: $\frac{1}{3}$
⚠️ Common mistake
Expecting every short decimal to have a short binary form. $0.5$, $0.25$ and $0.375$ end in binary, but $0.1$, $0.2$ and $0.3$ never do, so a computer must cut them off and round. Quick check: write the decimal as a fraction in lowest terms and look at the denominator. Any factor other than 2 (such as the 5 in 10) means the binary digits go on forever.
This is why $0.1 + 0.2$ is not exactly $0.3$ on a computer: none of the three is stored exactly. The next topic, Floating-Point Numbers, measures how far off they are.
Practice
Pass with 3 right answers, the last 2 in a row. Each right answer earns 2 XP.
Tobin A. Driscoll and Richard J. Braun, Fundamentals of Numerical Computation (University of Delaware, free online edition): chapter "Introduction", section "Floating-point numbers"
Autar Kaw, Holistic Numerical Methods (University of South Florida): Introduction to Numerical Methods, "Binary Representation of Numbers"