Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
TryRngCore
TryCryptoRng
1 parent e79f6b3 commit 0217ad9Copy full SHA for 0217ad9
1 file changed
tests/uniformity.rs
@@ -23,7 +23,7 @@ fn unit_sphere() {
23
let h = Histogram100::with_const_width(-1., 1.);
24
let mut histograms = [h.clone(), h.clone(), h];
25
let dist = rand_distr::UnitSphere;
26
- let mut rng = rand_pcg::Pcg32::from_entropy();
+ let mut rng = rand_pcg::Pcg32::from_os_rng();
27
for _ in 0..N_SAMPLES {
28
let v: [f64; 3] = dist.sample(&mut rng);
29
for i in 0..N_DIM {
@@ -51,7 +51,7 @@ fn unit_circle() {
51
use core::f64::consts::PI;
52
let mut h = Histogram100::with_const_width(-PI, PI);
53
let dist = rand_distr::UnitCircle;
54
55
56
let v: [f64; 2] = dist.sample(&mut rng);
57
h.add(v[0].atan2(v[1])).unwrap();
0 commit comments