### Rand32::new_inc Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand32.html Creates a new PRNG with a given seed and increment. The increment selects the sequence, and the seed selects the starting point. ```APIDOC ## Rand32::new_inc ### Description Creates a new PRNG. The two inputs, seed and increment, determine what you get; increment basically selects which sequence of all those possible the PRNG will produce, and the seed selects where in that sequence you start. Both are arbitrary; increment must be an odd number but this handles that for you. ### Method pub fn new_inc(seed: u64, increment: u64) -> Self ### Parameters - **seed** (u64) - Required - The seed for the PRNG. - **increment** (u64) - Required - The increment for the PRNG. Must be odd, but the method handles that. ### Returns - **Self** - A new Rand32 instance. ``` -------------------------------- ### Rand64::from_state Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Creates a new PRNG from a saved state. This is not quite the same as new_inc() because new_inc() does a little extra setup work to initialize the state. ```APIDOC ## Rand64::from_state ### Description Creates a new PRNG from a saved state. This is not quite the same as new_inc() because new_inc() does a little extra setup work to initialize the state. ### Method Signature pub fn from_state(state: (u128, u128)) -> Self ### Parameters - **state** ((u128, u128)) - Required - A tuple containing the state and increment values from a previous Rand64 instance. ### Return Value - **Self** - A new Rand64 instance. ``` -------------------------------- ### pub fn from_state(state: (u128, u128)) -> Self Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand64.html Creates a new PRNG from a saved state, allowing restoration of a previous PRNG sequence. ```APIDOC ## Method from_state ### Description Creates a new PRNG from a saved state from `state()`. This is NOT quite the same as `new_inc()` because `new_inc()` does a little extra setup work to initialize the state. ### Signature `pub fn from_state(state: (u128, u128)) -> Self` ### Parameters - **state**: `(u128, u128)` - The saved state to restore. ### Returns `Self` - A new `Rand64` instance. ``` -------------------------------- ### pub fn new(seed: u128) -> Self Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand64.html Creates a new PRNG with the given seed and the default increment. ```APIDOC ## Method new ### Description Creates a new PRNG with the given seed and a default increment. ### Signature `pub fn new(seed: u128) -> Self` ### Parameters - **seed**: `u128` - The seed for the PRNG. ### Returns `Self` - A new `Rand64` instance. ``` -------------------------------- ### pub fn rand_i64(&mut self) -> i64 Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand64.html Produces a random i64 in the inclusive range [i64::MIN, i64::MAX]. ```APIDOC ## Method rand_i64 ### Description Produces a random `i64` in the range `[i64::MIN, i64::MAX]`. ### Signature `pub fn rand_i64(&mut self) -> i64` ### Parameters None. ### Returns `i64` - A random signed 64-bit integer. ``` -------------------------------- ### pub fn rand_u64(&mut self) -> u64 Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand64.html Produces a random u64 in the inclusive range [0, u64::MAX]. ```APIDOC ## Method rand_u64 ### Description Produces a random `u64` in the range `[0, u64::MAX]`. ### Signature `pub fn rand_u64(&mut self) -> u64` ### Parameters None. ### Returns `u64` - A random unsigned 64-bit integer. ``` -------------------------------- ### pub fn new_inc(seed: u128, increment: u128) -> Self Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand64.html Creates a new PRNG with the given seed and increment. ```APIDOC ## Method new_inc ### Description Creates a new PRNG with the given seed and increment. Same as `Rand32::new_inc()`. ### Signature `pub fn new_inc(seed: u128, increment: u128) -> Self` ### Parameters - **seed**: `u128` - The seed for the PRNG. - **increment**: `u128` - The increment for the PRNG. ### Returns `Self` - A new `Rand64` instance. ``` -------------------------------- ### Rand64::new Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Creates a new Rand64 PRNG with the given seed and a default increment. This is the primary constructor for the 64-bit random number generator. ```APIDOC ## Rand64::new ### Description Creates a new Rand64 PRNG with the given seed and a default increment. This is the primary constructor for the 64-bit random number generator. ### Method Signature pub fn new(seed: u128) -> Self ### Parameters - **seed** (u128) - Required - The seed value for the PRNG. ### Return Value - **Self** - A new Rand64 instance. ``` -------------------------------- ### Rand32::new Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand32.html Creates a new PRNG with the given seed and a default increment. ```APIDOC ## Rand32::new ### Description Creates a new PRNG with the given seed and a default increment. ### Method pub fn new(seed: u64) -> Self ### Parameters - **seed** (u64) - Required - The seed for the PRNG. ### Returns - **Self** - A new Rand32 instance. ``` -------------------------------- ### Commented-out test_rand64_vs_rand: Rand64 vs rand_pcg::Pcg64 (not working) Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Commented-out Rust test that would compare Rand64 with rand_pcg::Pcg64, but is disabled because rand uses PCG-XSL-RR while oorandom uses PCG-XSH-RR, so outputs do not match. ```rust // This doesn't work 'cause for 64-bit output `rand` uses // PCG-XSL-RR // and we use // PCG-XSH-RR /* #[test] fn test_rand64_vs_rand() { use rand_pcg; use rand_core::RngCore; { let seed = 54321; let mut r1 = Rand64::new(seed); let mut r2 = rand_pcg::Pcg64::new(seed, Rand64::DEFAULT_INC); for _ in 0..1000 { assert_eq!(r1.rand(), r2.next_u64()); } } { let seed = 3141592653; let inc = 0xDEADBEEF; let mut r1 = Rand64::new_inc(seed, inc); let mut r2 = rand_pcg::Pcg64::new(seed, inc); for _ in 0..1000 { assert_eq!(r1.rand(), r2.next_u64()); } } } */ ``` -------------------------------- ### pub fn state(&self) -> (u128, u128) Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand64.html Returns the internal state of the PRNG, allowing saving and restoring the PRNG state. ```APIDOC ## Method state ### Description Returns the internal state of the PRNG. This allows you to save a PRNG and create a new one that will resume from the same spot in the sequence. ### Signature `pub fn state(&self) -> (u128, u128)` ### Parameters None. ### Returns `(u128, u128)` - A tuple representing the internal state. ``` -------------------------------- ### rand_range method implementation Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Generates a random u64 within the given bounds, inclusive of the lower bound and exclusive of the upper bound. Requires that range.start < range.end. Uses a rejection sampling technique to avoid modulo bias. ```rust pub fn rand_range(&mut self, range: Range) -> u64 { // Same as `Rand32::rand_range()` debug_assert!(range.start < range.end); let range_starting_from_zero = 0..(range.end - range.start); let s: u64 = range_starting_from_zero.end; let mut m: u128 = u128::from(self.rand_u64()) * u128::from(s); let mut leftover: u64 = (m & 0xFFFFFFFF_FFFFFFFF) as u64; if leftover < s { // TODO: Verify the wrapping_negate() here let threshold: u64 = s.wrapping_neg() % s; while leftover < threshold { m = u128::from(self.rand_u64()) * u128::from(s); leftover = (m & 0xFFFFFFFF_FFFFFFFF) as u64; } } (m.wrapping_shr(64)) as u64 + range.start } ``` -------------------------------- ### Rand32::from_state Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand32.html Creates a new PRNG from a saved state obtained from Rand32::state(). ```APIDOC ## Rand32::from_state ### Description Creates a new PRNG from a saved state from Rand32::state(). This is NOT quite the same as new_inc() because new_inc() does a little extra setup work to initialize the state. ### Method pub fn from_state(state: (u64, u64)) -> Self ### Parameters - **state** ((u64, u64)) - Required - The saved state from Rand32::state(). ### Returns - **Self** - A new Rand32 instance. ``` -------------------------------- ### Test RNG state save and restore Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Verifies that saving the state of an RNG and creating a new instance from that state produces identical behavior for both Rand32 and Rand64. ```rust #[test] fn test_save_restore() { { let seed = 54321; let mut r1 = Rand32::new(seed); let s1 = r1.state(); let mut r2 = Rand32::from_state(s1); assert_eq!(r1, r2); for _ in 0..1000 { assert_eq!(r1.rand_u32(), r2.rand_u32()); } } { let seed = 3141592653; let inc = 0xDEADBEEF; let mut r1 = Rand32::new_inc(seed, inc); let s1 = r1.state(); let mut r2 = Rand32::from_state(s1); assert_eq!(r1, r2); for _ in 0..1000 { assert_eq!(r1.rand_u32(), r2.rand_u32()); } } { let seed = 54321; let mut r1 = Rand64::new(seed); let s1 = r1.state(); let mut r2 = Rand64::from_state(s1); assert_eq!(r1, r2); for _ in 0..1000 { assert_eq!(r1.rand_u64(), r2.rand_u64()); } } { let seed = 3141592653; let inc = 0xDEADBEEF; let mut r1 = Rand64::new_inc(seed, inc); let s1 = r1.state(); let mut r2 = Rand64::from_state(s1); assert_eq!(r1, r2); for _ in 0..1000 { assert_eq!(r1.rand_u64(), r2.rand_u64()); } } } ``` -------------------------------- ### Test module for Rand32 and Rand64 against randomize Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Contains unit tests that validate the Rand32 and Rand64 generators against the randomize crate's PCG32 and PCG64. Tests cover random integer generation, float generation, and range validation. ```rust #[cfg(test)] mod tests { use super::*; use randomize::{self, PCG32, PCG64}; #[test] fn test_rand32_vs_randomize() { // Generate some random numbers and validate them against // a known-good generator. { let seed = 54321; let mut r1 = Rand32::new(seed); let mut r2 = PCG32::seed(seed, Rand32::DEFAULT_INC); for _ in 0..1000 { assert_eq!(r1.rand_u32(), r2.next_u32()); assert_eq!(r1.rand_i32(), r2.next_u32() as i32); } } { let seed = 3141592653; let inc = 0xDEADBEEF; let mut r1 = Rand32::new_inc(seed, inc); let mut r2 = PCG32::seed(seed, inc); for _ in 0..1000 { assert_eq!(r1.rand_u32(), r2.next_u32()); assert_eq!(r1.rand_i32(), r2.next_u32() as i32); } } } #[test] fn test_rand64_vs_randomize() { // Generate some random numbers and validate them against // a known-good generator. { let seed = 54321; let mut r1 = Rand64::new(seed); let mut r2 = PCG64::seed(seed, Rand64::DEFAULT_INC); for _ in 0..1000 { assert_eq!(r1.rand_u64(), r2.next_u64()); assert_eq!(r1.rand_i64(), r2.next_u64() as i64); } } { let seed = 3141592653; let inc = 0xDEADBEEF; let mut r1 = Rand64::new_inc(seed, inc); let mut r2 = PCG64::seed(seed, inc); for _ in 0..1000 { assert_eq!(r1.rand_u64(), r2.next_u64()); assert_eq!(r1.rand_i64(), r2.next_u64() as i64); } } } #[test] fn test_float32() { { let seed = 2718281828; let mut r1 = Rand32::new(seed); let mut r2 = PCG32::seed(seed, Rand32::DEFAULT_INC); for _ in 0..1000 { // First just make sure they both work with randomize's // f32 conversion function -- sanity checks. let i1 = r1.rand_u32(); let i2 = r2.next_u32(); assert_eq!(i1, i2); let f1 = randomize::f32_half_open_right(i1); let f2 = randomize::f32_half_open_right(i2); // We can directly compare floats 'cause we do no math, it's // literally the same bitwise algorithm with the same inputs. assert_eq!(f1, f2); // Make sure result is in [0.0, 1.0) assert!(f1 >= 0.0); assert!(f1 < 1.0); } // At least make sure our float's from rand_float() are in the valid range. for _ in 0..1000 { let f1 = r1.rand_float(); assert!(f1 >= 0.0); assert!(f1 < 1.0); } /* TODO: Randomize changed its int-to-float conversion functions and now they don't match ours. for _ in 0..1000 { // Now make sure our own float conversion function works. let f1 = r1.rand_float(); //let f2 = randomize::f32_half_open_right(r2.next_u32()); let f2 = randomize::f32_open(r2.next_u32()); assert_eq!(f1, f2); assert!(f1 >= 0.0); assert!(f1 < 1.0); } */ } } } ``` -------------------------------- ### pub fn rand_float(&mut self) -> f64 Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand64.html Produces a random f64 in the range [0.0, 1.0). ```APIDOC ## Method rand_float ### Description Produces a random `f64` in the range `[0.0, 1.0)`. ### Signature `pub fn rand_float(&mut self) -> f64` ### Parameters None. ### Returns `f64` - A random floating-point number between 0.0 (inclusive) and 1.0 (exclusive). ``` -------------------------------- ### test_float64: Compare Rand64 with randomize::PCG64 and validate float output Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Rust test that seeds Rand64 and randomize::PCG64 with the same seed and default increment, then asserts their u64 outputs and f64 conversions match. Also verifies rand_float() returns values in [0.0, 1.0). Includes a commented-out block noting randomize's int-to-float conversion changed and no longer matches. ```rust #[test] fn test_float64() { { let seed = 2718281828; let mut r1 = Rand64::new(seed); let mut r2 = PCG64::seed(seed, Rand64::DEFAULT_INC); for _ in 0..1000 { // First just make sure they both work with randomize's // f64 conversion function -- sanity checks. let i1 = r1.rand_u64(); let i2 = r2.next_u64(); assert_eq!(i1, i2); let f1 = randomize::f64_half_open_right(i1); let f2 = randomize::f64_half_open_right(i2); // We can directly compare floats 'cause we do no math, it's // literally the same bitwise algorithm with the same inputs. assert_eq!(f1, f2); // Make sure result is in [0.0, 1.0) assert!(f1 >= 0.0); assert!(f1 < 1.0); } // At least make sure our float's from rand_float() are in the valid range. for _ in 0..1000 { let f1 = r1.rand_float(); assert!(f1 >= 0.0); assert!(f1 < 1.0); } /* TODO: Randomize changed its int-to-float conversion functions and now they don't match ours. for _ in 0..1000 { // Now make sure our own float conversion function works. let f1 = r1.rand_float(); //let f2 = randomize::f32_half_open_right(r2.next_u32()); let f2 = randomize::f32_open(r2.next_u32()); assert_eq!(f1, f2); assert!(f1 >= 0.0); assert!(f1 < 1.0); } */ } } ``` -------------------------------- ### Rand32::rand_i32 Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand32.html Produces a random i32 in the range [i32::MIN, i32::MAX]. ```APIDOC ## Rand32::rand_i32 ### Description Produces a random i32 in the range [i32::MIN, i32::MAX]. ### Method pub fn rand_i32(&mut self) -> i32 ### Parameters None. ### Returns - **i32** - A random i32 value. ``` -------------------------------- ### Test Rand32 against random-fast-rng Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Compares Rand32 output against the random-fast-rng crate using both default and custom increments to ensure consistency. ```rust #[test] fn test_rand32_vs_rfr() { use random_fast_rng as rfr; use rfr::Random; { let seed = 54321; let mut r1 = Rand32::new(seed); let mut r2 = rfr::FastRng::seed(seed, Rand32::DEFAULT_INC); for _ in 0..1000 { assert_eq!(r1.rand_u32(), r2.get_u32()); } } { let seed = 3141592653; let inc = 0xDEADBEEF; let mut r1 = Rand32::new_inc(seed, inc); let mut r2 = rfr::FastRng::seed(seed, inc); for _ in 0..1000 { assert_eq!(r1.rand_u32(), r2.get_u32()); } } } ``` -------------------------------- ### Rand64::new_inc Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Creates a new Rand64 PRNG with the given seed and a custom increment. This allows for more control over the PRNG's behavior. ```APIDOC ## Rand64::new_inc ### Description Creates a new Rand64 PRNG with the given seed and a custom increment. This allows for more control over the PRNG's behavior. ### Method Signature pub fn new_inc(seed: u128, increment: u128) -> Self ### Parameters - **seed** (u128) - Required - The seed value for the PRNG. - **increment** (u128) - Required - The increment value for the PRNG. ### Return Value - **Self** - A new Rand64 instance. ``` -------------------------------- ### Rand64::state Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Returns the internal state of the PRNG, allowing you to save a PRNG and create a new one that will resume from the same spot in the sequence. ```APIDOC ## Rand64::state ### Description Returns the internal state of the PRNG, allowing you to save a PRNG and create a new one that will resume from the same spot in the sequence. ### Method Signature pub fn state(&self) -> (u128, u128) ### Return Value - **(u128, u128)** - A tuple containing the current state and increment values. ``` -------------------------------- ### test_rand32_vs_rand: Compare Rand32 with rand_pcg::Pcg32 Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Rust test that compares Rand32 output with rand_pcg::Pcg32 using both default increment and a custom increment (0xDEADBEEF). Asserts that rand_u32() matches next_u32() for 1000 iterations in each case. ```rust #[test] fn test_rand32_vs_rand() { use rand_core::RngCore; use rand_pcg; { let seed = 54321; let mut r1 = Rand32::new(seed); let mut r2 = rand_pcg::Pcg32::new(seed, Rand32::DEFAULT_INC); for _ in 0..1000 { assert_eq!(r1.rand_u32(), r2.next_u32()); } } { let seed = 3141592653; let inc = 0xDEADBEEF; let mut r1 = Rand32::new_inc(seed, inc); let mut r2 = rand_pcg::Pcg32::new(seed, inc); for _ in 0..1000 { assert_eq!(r1.rand_u32(), r2.next_u32()); } } } ``` -------------------------------- ### Rand32::state Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand32.html Returns the internal state of the PRNG, allowing saving and restoring the PRNG state. ```APIDOC ## Rand32::state ### Description Returns the internal state of the PRNG. This allows you to save a PRNG and create a new one that will resume from the same spot in the sequence. ### Method pub fn state(&self) -> (u64, u64) ### Parameters None. ### Returns - **(u64, u64)** - The internal state of the PRNG. ``` -------------------------------- ### Rand64::rand_u64 Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Produces a random u64 in the range [0, u64::MAX]. This is the core random number generation method for the 64-bit PRNG. ```APIDOC ## Rand64::rand_u64 ### Description Produces a random u64 in the range [0, u64::MAX]. This is the core random number generation method for the 64-bit PRNG. ### Method Signature pub fn rand_u64(&mut self) -> u64 ### Return Value - **u64** - A random 64-bit unsigned integer. ``` -------------------------------- ### Rand64::rand_i64 Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Produces a random i64 in the range [i64::MIN, i64::MAX]. This method casts the result of rand_u64 to a signed integer. ```APIDOC ## Rand64::rand_i64 ### Description Produces a random i64 in the range [i64::MIN, i64::MAX]. This method casts the result of rand_u64 to a signed integer. ### Method Signature pub fn rand_i64(&mut self) -> i64 ### Return Value - **i64** - A random 64-bit signed integer. ``` -------------------------------- ### Rand32::rand_u32 Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand32.html Produces a random u32 in the range [0, u32::MAX]. ```APIDOC ## Rand32::rand_u32 ### Description Produces a random u32 in the range [0, u32::MAX]. ### Method pub fn rand_u32(&mut self) -> u32 ### Parameters None. ### Returns - **u32** - A random u32 value. ``` -------------------------------- ### test_randrange64: Validate Rand64::rand_range bounds Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Rust test that seeds Rand64 and generates 1000 random low/high bounds, then calls rand_range(low..high) and asserts the result is within [low, high). Skips cases where bounds are equal. ```rust #[test] fn test_randrange64() { // Make sure ranges are valid and in the given range let seed = 2342_2718; let mut r1 = Rand64::new(seed); for _ in 0..1000 { // Generate our bounds at random let a = r1.rand_u64(); let b = r1.rand_u64(); if a == b { continue; } let (low, high) = if a < b { (a, b) } else { (b, a) }; // Get a number in that range let in_range = r1.rand_range(low..high); assert!(in_range >= low); assert!(in_range < high); } } ``` -------------------------------- ### Rand32::rand_float Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand32.html Produces a random f32 in the range [0.0, 1.0). ```APIDOC ## Rand32::rand_float ### Description Produces a random f32 in the range [0.0, 1.0). ### Method pub fn rand_float(&mut self) -> f32 ### Parameters None. ### Returns - **f32** - A random f32 value in [0.0, 1.0). ``` -------------------------------- ### test_randrange32: Validate Rand32::rand_range bounds Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Rust test that seeds Rand32 and generates 1000 random low/high bounds, then calls rand_range(low..high) and asserts the result is within [low, high). Skips cases where bounds are equal. ```rust #[test] fn test_randrange32() { // Make sure ranges are valid and in the given range let seed = 2342_3141; let mut r1 = Rand32::new(seed); for _ in 0..1000 { // Generate our bounds at random let a = r1.rand_u32(); let b = r1.rand_u32(); if a == b { continue; } let (low, high) = if a < b { (a, b) } else { (b, a) }; // Get a number in that range let in_range = r1.rand_range(low..high); assert!(in_range >= low); assert!(in_range < high); } } ``` -------------------------------- ### pub fn rand_range(&mut self, range: Range) -> u64 Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand64.html Produces a random value within the given range, inclusive of lower bound, exclusive of upper bound. ```APIDOC ## Method rand_range ### Description Produces a random within the given bounds. Like any `Range`, it includes the lower bound and excludes the upper one. Requires that `range.end <= range.start`. ### Signature `pub fn rand_range(&mut self, range: Range) -> u64` ### Parameters - **range**: `Range` - The inclusive lower and exclusive upper bounds. ### Returns `u64` - A random number in the specified range. ``` -------------------------------- ### pub const DEFAULT_INC: u128 Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand64.html The default value for the increment used in the PCG-XSH-RR algorithm. ```APIDOC ## Constant DEFAULT_INC ### Description The default value for `increment`. Used by `new` and `new_inc` when no increment is provided. ### Signature `pub const DEFAULT_INC: u128` ### Value `0x2FE0E169_FFBD06E3_5BC307BD_4D2F814F` ``` -------------------------------- ### Rand32::rand_range Source: https://docs.rs/oorandom/latest/oorandom/struct.Rand32.html Produces a random u32 within the given bounds. The range includes the lower bound and excludes the upper bound. ```APIDOC ## Rand32::rand_range ### Description Produces a random within the given bounds. Like any Range, it includes the lower bound and excludes the upper one. This should be faster than Self::rand() % end + start, but the real advantage is it's more convenient. Requires that range.end <= range.start. ### Method pub fn rand_range(&mut self, range: Range) -> u32 ### Parameters - **range** (Range) - Required - The range of values to generate. Must satisfy range.end <= range.start. ### Returns - **u32** - A random u32 within the specified range. ``` -------------------------------- ### Rand64::rand_float Source: https://docs.rs/oorandom/latest/src/oorandom/lib.rs.html Produces a random f64 in the range [0.0, 1.0). This method generates a floating-point number with full precision. ```APIDOC ## Rand64::rand_float ### Description Produces a random f64 in the range [0.0, 1.0). This method generates a floating-point number with full precision. ### Method Signature pub fn rand_float(&mut self) -> f64 ### Return Value - **f64** - A random floating-point number between 0.0 (inclusive) and 1.0 (exclusive). ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.