iter-rationals
This crate implements an iterator over the rational numbers which:
- yields each number once-and-only-once,
- requires only a fixed amount of memory, and
- yields successive values with a fixed amount of arithmetic operations.
The algorithm is described in Functional Pearl: Enumerating the Rationals by Gibbons, Lester, and Bird; see the paper for an explanation of how it works.
Usage
use Rationals;
Installation
Add this dependency to your Cargo.toml:
iter-rationals = "0.1"
or on the command line:
cargo add iter-rationals