time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

commit 3fa55de18f1e7636e3a175f60de9068efc3c09d4
parent f6391a3d79faf59e28419d5cf768bfdb8157583d
Author: NunoSempere <nuno.semperelh@protonmail.com>
Date:   Sat,  6 Apr 2024 11:26:23 -0400

savepoint

Diffstat:
Mrust/src/main.rs | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rust/src/main.rs b/rust/src/main.rs @@ -5,7 +5,7 @@ use rand_distr::{Normal, Distribution}; // use rand::thread_rng; // use rand::prelude::* -fn model(rng: &mut Pcg64Mcg) -> f64 { +fn model(rng: Pcg64Mcg) -> f64 { let x = 1.0; let normal = Normal::new(2.0, 3.0).unwrap(); let v = normal.sample(&mut rng); @@ -17,9 +17,9 @@ fn main() { let mut rng = Pcg64Mcg::seed_from_u64(1); // mean 2, standard deviation 3 - let v = model(&mut rng); + let v = model(rng); println!("{} is from a N(2, 9) distribution", v); - let z = model(&mut rng); + let z = model(rng); println!("{} is from a N(2, 9) distribution", z); }