#mathematics #numerics #fractions

no-std num-rational

Rational numbers implementation for Rust

13 releases

0.2.4 Mar 17, 2020
0.2.2 Jun 11, 2019
0.2.1 Jun 23, 2018
0.1.42 Feb 9, 2018
0.1.32 Apr 14, 2016

#4 in Math

Download history 58606/week @ 2019-12-02 57255/week @ 2019-12-09 52400/week @ 2019-12-16 33383/week @ 2019-12-23 37925/week @ 2019-12-30 61244/week @ 2020-01-06 66994/week @ 2020-01-13 70836/week @ 2020-01-20 65850/week @ 2020-01-27 67039/week @ 2020-02-03 69695/week @ 2020-02-10 67273/week @ 2020-02-17 70620/week @ 2020-02-24 68719/week @ 2020-03-02 68124/week @ 2020-03-09 70248/week @ 2020-03-16

262,815 downloads per month
Used in 1,594 crates (39 directly)

MIT/Apache

85KB
2K SLoC

num-rational

crate documentation minimum rustc 1.15 Travis status

Generic Rational numbers (aka fractions) for Rust.

Usage

Add this to your Cargo.toml:

[dependencies]
num-rational = "0.2"

and this to your crate root:

extern crate num_rational;

Features

This crate can be used without the standard library (#![no_std]) by disabling the default std feature. Use this in Cargo.toml:

[dependencies.num-rational]
version = "0.2"
default-features = false

Implementations for i128 and u128 are only available with Rust 1.26 and later. The build script automatically detects this, but you can make it mandatory by enabling the i128 crate feature.

Releases

Release notes are available in RELEASES.md.

Compatibility

The num-rational crate is tested for rustc 1.15 and greater.

Dependencies

~130–310KB