commit | 4493cf22ba3f1ed10ae919ba7fa1b23389a25936 | [log] [tgz] |
---|---|---|
author | Sam Dubey <dubeyshubham@google.com> | Mon Jan 23 21:36:21 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Jan 23 21:36:21 2023 +0000 |
tree | 8d1f4f4744f77291db77d5a7772d253dea1767c8 | |
parent | a1f98f856a286cdc13af8f7466b87ea21ac46096 [diff] | |
parent | 032a0923f4be11d56ab63d8febb3f6c96369f580 [diff] |
[automerger skipped] Fix test mapping files with updated test name am: fa0a043874 am: d5957dbf6b am: 032a0923f4 -s ours am skip reason: Merged-In I7e31732a82b1dcfa620077d7490279837f1c4341 with SHA-1 a1f98f856a is already in history Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/num-traits/+/2399714 Change-Id: I8d06612d3fa145d7612b276abaed167fcfd1f138 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Numeric traits for generic mathematics in Rust.
Add this to your Cargo.toml
:
[dependencies] num-traits = "0.2"
This crate can be used without the standard library (#![no_std]
) by disabling the default std
feature. Use this in Cargo.toml
:
[dependencies.num-traits] version = "0.2" default-features = false # features = ["libm"] # <--- Uncomment if you wish to use `Float` and `Real` without `std`
The Float
and Real
traits are only available when either std
or libm
is enabled.
The libm
feature is only available with Rust 1.31 and later (see PR #99).
The FloatCore
trait is always available. MulAdd
and MulAddAssign
for f32
and f64
also require std
or libm
, as do implementations of signed and floating- point exponents in Pow
.
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.
Release notes are available in RELEASES.md.
The num-traits
crate is tested for rustc 1.8 and greater.
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.