O'Reilly logo

Good Math by Mark C. Chu-Carroll

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required