Skip to main content

randomFloat

Function randomFloat 

Source
pub fn randomFloat() -> f64
Expand description

Generates a random floating-point number.

§Returns

A random float in the range [0.0, 1.0) (includes 0.0, excludes 1.0).

§Example

use logicaffeine_system::random;

let chance = random::randomFloat();
assert!((0.0..1.0).contains(&chance));