In 1972, mathematician Bill Gosper described an ingenious method for performing arithmetic on continued fractions (see here for his original publication). This repo provides a Python implementation, and an article to explain the logic.
The code was written as an exercise in literate programming. The Python code was written as parts of an article, using the orgmode markup, which is popular among Emacs users. The main article is in the org/
directory. The Python code blocks can be extracted from the .org
files, and assembled into normal Python code in src/
. In Emacs, this process is done with the org-html-export-to-html
command. On a computer with Emacs installed, you can also run make tangle
.