Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/rayon-monte-carlo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static BATCH_SIZE: u64 = 10_000;
static BATCHES: u64 = 1000;

fn main() {
let range = Uniform::new(-1.0f64, 1.0);
let range = Uniform::new(-1.0f64, 1.0).unwrap();

let in_circle = (0..BATCHES)
.into_par_iter()
Expand Down
2 changes: 1 addition & 1 deletion src/distributions/uniform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
use core::fmt;
use core::time::Duration;
use core::ops::{Range, RangeInclusive};
use std::convert::TryFrom;
use core::convert::TryFrom;

use crate::distributions::float::IntoFloat;
use crate::distributions::utils::{BoolAsSIMD, FloatAsSIMD, FloatSIMDUtils, IntAsSIMD, WideningMultiply};
Expand Down
1 change: 0 additions & 1 deletion src/distributions/weighted_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ impl<X> Distribution<usize> for WeightedIndex<X>
where X: SampleUniform + PartialOrd
{
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> usize {
use ::core::cmp::Ordering;
let chosen_weight = self.weight_distribution.sample(rng);
// Find the first item which has a weight *higher* than the chosen weight.
self.cumulative_weights.partition_point(|w| w <= &chosen_weight)
Expand Down