11Continued Fractions
The way that we write numbers that aren’t integers is annoying and frustrating.
We’ve got two choices: we can write them as fractions or we can write them as decimals. But both have serious problems. There are some numbers that we can write easily as fractions, like 1/3 or 4/7. That’s great. But there are some numbers that you just can’t write as a fraction, like π.
For numbers like π, there are fractions that are close. 22/7 is a common approximation for π. But fractions are terrible for that: if you need to be a bit more precise than that, you can’t change it a little bit; you need to come up with a totally different fraction. That’s one of the reasons that decimals are great. We can approximate a number like π using ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access