Doing Arithmetic
Of course, a natural question at this point is, can you actually do arithmetic with these things? They’re pretty, and they’re interesting, but can you actually use them? Can you do arithmetic with them?
And the answer is heck yes (so long as you’re a computer).
For a long time, no one realized that. It took until 1972, when an interesting guy named Bill Gosper came up with a solution.[7] The full details of Gosper’s methods are pretty hairy, but the basic idea of the method isn’t that hard.
Gosper’s fundamental insight was that you could use what we now call lazy evaluation to do continued-fraction arithmetic. With lazy evaluation, you don’t need to compute the digits of a continued fraction all at once; you compute them ...
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