#rational-numbers #fraction #numeric

no-std num-rational

Rational numbers implementation for Rust

18 releases

0.4.1 Jun 23, 2022
0.4.0 Mar 6, 2021
0.3.2 Nov 6, 2020
0.3.0 Jun 13, 2020
0.1.32 Apr 14, 2016

#5 in Math

Download history 343683/week @ 2023-12-23 612041/week @ 2023-12-30 758452/week @ 2024-01-06 708935/week @ 2024-01-13 758177/week @ 2024-01-20 769220/week @ 2024-01-27 701385/week @ 2024-02-03 736998/week @ 2024-02-10 686853/week @ 2024-02-17 755860/week @ 2024-02-24 769500/week @ 2024-03-02 760305/week @ 2024-03-09 791293/week @ 2024-03-16 796629/week @ 2024-03-23 841416/week @ 2024-03-30 736317/week @ 2024-04-06

3,294,540 downloads per month
Used in 8,172 crates (169 directly)

MIT/Apache

115KB
3K SLoC

num-rational

crate documentation minimum rustc 1.31 build status

Generic Rational numbers (aka fractions) for Rust.

Usage

Add this to your Cargo.toml:

[dependencies]
num-rational = "0.4"

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.4"
default-features = false

Releases

Release notes are available in RELEASES.md.

Compatibility

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

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~145–450KB