Cleaner, Clearer, and Just Plain Fun
Continued fractions really are interesting buggers. They’re interesting both in theoretical terms and in terms of just fun, odd properties.
With regular fractions, it’s easy to take the reciprocal—you just swap the numerator and the denominator. It looks like it’s going to be difficult to do that with a continued fraction, but it isn’t. It’s even easier! Take a number like 2.3456, aka [2; 2, 3, 1, 3, 4, 5, 6, 4]. The reciprocal is [0; 2, 2, 3, 1, 3, 4, 5, 6, 4]. We just add a zero to the front as the integer part, and push everything else one place to the right. If it was a zero in front, then we would have removed the zero and pulled everything else one place to the left.
Using continued fractions, we ...
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