Skip to content

Commit

Permalink
Expose UniformNotNan and UniformOrdered (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisWellmann committed Aug 17, 2023
1 parent 27d6eb6 commit d64c3c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ use num_traits::{
#[cfg(feature = "std")]
pub use num_traits::{Float, Pow};

#[cfg(feature = "rand")]
pub use impl_rand::UniformOrdered;

// masks for the parts of the IEEE 754 float
const SIGN_MASK: u64 = 0x8000000000000000u64;
const EXP_MASK: u64 = 0x7ff0000000000000u64;
Expand Down Expand Up @@ -2253,6 +2256,7 @@ mod impl_rand {
type Sampler = UniformNotNan<f64>;
}

/// A sampler for a uniform distribution
#[derive(Clone, Copy, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct UniformOrdered<T>(UniformFloat<T>);
Expand Down

0 comments on commit d64c3c3

Please sign in to comment.