diff --git a/rand_distr/CHANGELOG.md b/rand_distr/CHANGELOG.md index b93933e9ec9..6b0cda28ba6 100644 --- a/rand_distr/CHANGELOG.md +++ b/rand_distr/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.4.3] - 2021-12-30 +- Fix `no_std` build (#1208) + ## [0.4.2] - 2021-09-18 - New `Zeta` and `Zipf` distributions (#1136) - New `SkewNormal` distribution (#1149) diff --git a/rand_distr/Cargo.toml b/rand_distr/Cargo.toml index 8a9638c80fb..32a5fcaf5ae 100644 --- a/rand_distr/Cargo.toml +++ b/rand_distr/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rand_distr" -version = "0.4.2" +version = "0.4.3" authors = ["The Rand Project Developers"] license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/rand_distr/src/binomial.rs b/rand_distr/src/binomial.rs index 8e7513a2477..d1637b6d1ee 100644 --- a/rand_distr/src/binomial.rs +++ b/rand_distr/src/binomial.rs @@ -13,6 +13,8 @@ use crate::{Distribution, Uniform}; use rand::Rng; use core::fmt; use core::cmp::Ordering; +#[allow(unused_imports)] +use num_traits::Float; /// The binomial distribution `Binomial(n, p)`. /// diff --git a/rand_distr/src/geometric.rs b/rand_distr/src/geometric.rs index 7988261a380..78ad6cce64b 100644 --- a/rand_distr/src/geometric.rs +++ b/rand_distr/src/geometric.rs @@ -3,6 +3,8 @@ use crate::Distribution; use rand::Rng; use core::fmt; +#[allow(unused_imports)] +use num_traits::Float; /// The geometric distribution `Geometric(p)` bounded to `[0, u64::MAX]`. /// diff --git a/rand_distr/src/hypergeometric.rs b/rand_distr/src/hypergeometric.rs index 8ab2dca0333..9a529096242 100644 --- a/rand_distr/src/hypergeometric.rs +++ b/rand_distr/src/hypergeometric.rs @@ -4,6 +4,8 @@ use crate::Distribution; use rand::Rng; use rand::distributions::uniform::Uniform; use core::fmt; +#[allow(unused_imports)] +use num_traits::Float; #[derive(Clone, Copy, Debug)] #[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))] diff --git a/rand_distr/src/utils.rs b/rand_distr/src/utils.rs index f097bb45780..4638e3623d2 100644 --- a/rand_distr/src/utils.rs +++ b/rand_distr/src/utils.rs @@ -11,6 +11,7 @@ use crate::ziggurat_tables; use rand::distributions::hidden_export::IntoFloat; use rand::Rng; +use num_traits::Float; /// Calculates ln(gamma(x)) (natural logarithm of the gamma /// function) using the Lanczos approximation. @@ -25,7 +26,7 @@ use rand::Rng; /// `Ag(z)` is an infinite series with coefficients that can be calculated /// ahead of time - we use just the first 6 terms, which is good enough /// for most purposes. -pub(crate) fn log_gamma(x: F) -> F { +pub(crate) fn log_gamma(x: F) -> F { // precalculated 6 coefficients for the first 6 terms of the series let coefficients: [F; 6] = [ F::from(76.18009172947146).unwrap(),