• Home
Name Date Size #Lines LOC

..--

src/03-May-2024-6,9653,450

tests/03-May-2024-398332

.cargo_vcs_info.jsonD03-May-202474 65

.gitignoreD03-May-202418 32

Android.bpD03-May-20243.1 KiB125114

Cargo.tomlD03-May-20241.2 KiB3936

Cargo.toml.origD03-May-2024697 2924

LICENSED03-May-202410.6 KiB202169

LICENSE-APACHED03-May-202410.6 KiB202169

LICENSE-MITD03-May-20241 KiB2622

METADATAD03-May-2024389 2019

MODULE_LICENSE_APACHE2D03-May-20240

OWNERSD03-May-202440 21

README.mdD03-May-20242.1 KiB7046

RELEASES.mdD03-May-20249.2 KiB232159

TEST_MAPPINGD03-May-2024204 1211

build.rsD03-May-2024511 2113

cargo2android.jsonD03-May-2024159 1010

README.md

1# num-traits
2
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)
7
8Numeric traits for generic mathematics in Rust.
9
10## Usage
11
12Add this to your `Cargo.toml`:
13
14```toml
15[dependencies]
16num-traits = "0.2"
17```
18
19and this to your crate root:
20
21```rust
22extern crate num_traits;
23```
24
25## Features
26
27This crate can be used without the standard library (`#![no_std]`) by disabling
28the default `std` feature. Use this in `Cargo.toml`:
29
30```toml
31[dependencies.num-traits]
32version = "0.2"
33default-features = false
34# features = ["libm"]    # <--- Uncomment if you wish to use `Float` and `Real` without `std`
35```
36
37The `Float` and `Real` traits are only available when either `std` or `libm` is enabled.
38The `libm` feature is only available with Rust 1.31 and later ([see PR #99](https://github.com/rust-num/num-traits/pull/99)).
39
40The `FloatCore` trait is always available.  `MulAdd` and `MulAddAssign` for `f32`
41and `f64` also require `std` or `libm`, as do implementations of signed and floating-
42point exponents in `Pow`.
43
44Implementations for `i128` and `u128` are only available with Rust 1.26 and
45later.  The build script automatically detects this, but you can make it
46mandatory by enabling the `i128` crate feature.
47
48## Releases
49
50Release notes are available in [RELEASES.md](RELEASES.md).
51
52## Compatibility
53
54The `num-traits` crate is tested for rustc 1.8 and greater.
55
56## License
57
58Licensed under either of
59
60 * [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
61 * [MIT license](http://opensource.org/licenses/MIT)
62
63at your option.
64
65### Contribution
66
67Unless you explicitly state otherwise, any contribution intentionally submitted
68for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
69dual licensed as above, without any additional terms or conditions.
70