A collection of numeric types and traits for Rust.
This includes new types for big integers, rationals (aka fractions), and complex numbers,
new traits for generic programming on numeric properties like
and generic range iterators.
num is a meta-crate, re-exporting items from these sub-crates:
num-derive is listed here for reference, but it's not directly included
num. This is a
proc-macro crate for deriving some of
Add this to your
[dependencies] num = "0.3"
This crate can be used without the standard library (
#![no_std]) by disabling
std feature. Use this in
[dependencies.num] version = "0.3" default-features = false
num-bigint crate requires the
std feature, or the
alloc feature may
be used instead with Rust 1.36 and later. Other sub-crates may also have
limited functionality when used without
libm feature uses pure-Rust floating point implementations in
builds, enabling the
Float trait and related
rand feature enables randomization traits in
serde feature enables serialization for types in
num meta-crate no longer supports features to toggle the inclusion of
the individual sub-crates. If you need such control, you are recommended to
directly depend on your required crates instead.
Release notes are available in RELEASES.md.
num crate as a whole is tested for rustc 1.31 and greater.
num-iter crates are individually tested
for rustc 1.8 and greater, if you require such older compatibility.
Licensed under either of
at your option.
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.