Continued Fractions
A continued fraction is a very neat thing. Here’s the idea: take a number where you don’t know its fractional form. Pick the nearest simple fraction 1/n that’s just a little bit too large. If you were looking at, say, 0.4, you’d take 1/2, because it’s a bit bigger. That gives you a first approximation of the number as a fraction. But it’s a little bit too big. If the value of a fraction is a little bit larger than you want it to be, that means that the denominator of that fraction is a little bit too small, and to fix it you need to add a correction to the denominator to make it a little bit bigger. A continued fraction works on that basic principle. Just keep adjusting the denominator; you approximate the correction to the ...
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