20 stable releases

2.1.0 Oct 12, 2021
2.0.0 Oct 12, 2021
1.3.0 Oct 12, 2021
1.2.5 Sep 22, 2021
0.1.0 Sep 20, 2021

#690 in Science

Download history 16/week @ 2024-02-19 4/week @ 2024-02-26 7/week @ 2024-03-11 346/week @ 2024-04-01

353 downloads per month

BSD-3-Clause

25KB
1K SLoC

frac

Fractional (rational) data type in Rust.

Example:

use frac::Frac;

fn main() {
    let f = Frac::new(3, 4) - Frac::new(5, 6);
    println!("{}", f); // -1/12
}

LICENSE: BSD 3-Clause

Current Version: 2.1.0

Contributors:

Crates.io

Docs.rs

GitHub


lib.rs:

Rational Data Type

This crate provides the Frac (fractional) data type, which represents a rational number.

No runtime deps