3 [![crate](https://img.shields.io/crates/v/num-traits.svg)](https://crates.io/crates/num-traits)
4 [![documentation](https://docs.rs/num-traits/badge.svg)](https://docs.rs/num-traits)
5 [![minimum rustc 1.8](https://img.shields.io/badge/rustc-1.8+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
6 [![build status](https://github.com/rust-num/num-traits/workflows/master/badge.svg)](https://github.com/rust-num/num-traits/actions)
8 Numeric traits for generic mathematics in Rust.
12 Add this to your `Cargo.toml`:
21 This crate can be used without the standard library (`#![no_std]`) by disabling
22 the default `std` feature. Use this in `Cargo.toml`:
25 [dependencies.num-traits]
27 default-features = false
28 # features = ["libm"] # <--- Uncomment if you wish to use `Float` and `Real` without `std`
31 The `Float` and `Real` traits are only available when either `std` or `libm` is enabled.
32 The `libm` feature is only available with Rust 1.31 and later ([see PR #99](https://github.com/rust-num/num-traits/pull/99)).
34 The `FloatCore` trait is always available. `MulAdd` and `MulAddAssign` for `f32`
35 and `f64` also require `std` or `libm`, as do implementations of signed and floating-
36 point exponents in `Pow`.
38 Implementations for `i128` and `u128` are only available with Rust 1.26 and
39 later. The build script automatically detects this, but you can make it
40 mandatory by enabling the `i128` crate feature.
44 Release notes are available in [RELEASES.md](RELEASES.md).
48 The `num-traits` crate is tested for rustc 1.8 and greater.
52 Licensed under either of
54 * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
55 * [MIT license](http://opensource.org/licenses/MIT)
61 Unless you explicitly state otherwise, any contribution intentionally submitted
62 for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
63 dual licensed as above, without any additional terms or conditions.