gosper 0.1.0

arbitrary precision continued fraction arithmetic
Documentation
  • Coverage
  • 49.07%
    53 out of 108 items documented16 out of 84 items with examples
  • Size
  • Source code size: 98.64 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 19.27 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 26s Average build duration of successful builds.
  • all releases: 26s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • themadcreator/gosper-rs
    7 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • themadcreator

gosper

Continued Fraction Arithmetic

This library implements several methods for arbitrary precision continued fraction arithmetic based on Bill Gosper's inspired preprint work in the 2nd appendix of the MIT HAKMEM publication[^1], where he writes:

Abstract: Contrary to everybody, [...] continued fractions are not only perfectly amenable to arithmetic, they are amenable to perfect arithmetic.

He then goes on to describe an algorithm for producing a continued fraction representing arithmetic operations (+, -, *, /) between arbitrary continued fractions.

The main benefit of this approach is that even if the operands are non-terminating continued fractions (such as representations of transcendental numbers, e.g π), consuming enough terms of the operands can bound the next term of the result to within the range of a single integer.

In this way, the terms of the result can be read off one at a time, and computation can be discontinued when the desired accuracy is attained.