diff --git a/rand_distr/Cargo.toml b/rand_distr/Cargo.toml index 917c307fee..35b7cb338c 100644 --- a/rand_distr/Cargo.toml +++ b/rand_distr/Cargo.toml @@ -23,7 +23,12 @@ rustdoc-args = ["--generate-link-to-definition"] default = ["std"] std = ["alloc", "rand/std"] alloc = ["rand/alloc"] + +# Use std's floating-point arithmetic instead of libm. +# Note that any other crate depending on `num-traits`'s `std` +# feature (default-enabled) will have the same effect. std_math = ["num-traits/std"] + serde1 = ["serde", "rand/serde1"] [dependencies] diff --git a/rand_distr/README.md b/rand_distr/README.md index f61e1b13d6..16a44bc85c 100644 --- a/rand_distr/README.md +++ b/rand_distr/README.md @@ -25,7 +25,8 @@ The floating point functions from `num_traits` and `libm` are used to support `no_std` environments and ensure reproducibility. If the floating point functions from `std` are preferred, which may provide better accuracy and performance but may produce different random values, the `std_math` feature -can be enabled. +can be enabled. (Note that any other crate depending on `num-traits` with the +`std` feature (default-enabled) will have the same effect.) ## Crate features