Skip to content

Commit a2afcec

Browse files
fmt and num_traits Float
1 parent 7378ba2 commit a2afcec

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

distr_test/tests/cdf.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,8 @@ fn truncated_normal() {
461461

462462
let normal = statrs::distribution::Normal::new(0.0, 1.0).unwrap();
463463

464-
let z = normal
465-
.cdf(standard_upper)
466-
- normal.cdf(standard_lower);
467-
(normal.cdf(standard_x)
468-
- normal.cdf(standard_lower))
469-
/ Z
464+
let z = normal.cdf(standard_upper) - normal.cdf(standard_lower);
465+
(normal.cdf(standard_x) - normal.cdf(standard_lower)) / Z
470466
}
471467
};
472468
test_continuous(seed as u64, dist, analytic);

src/normal_truncated.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
use rand::{Rng, distr::Distribution};
2+
#[allow(unused_imports)]
3+
use num_traits::Float;
24

35
/// The [truncated normal distribution](https://en.wikipedia.org/wiki/Truncated_normal_distribution).
46
///

0 commit comments

Comments
 (0)