Answers for "rust random float between 0 and 1"

0

rust random float between 0 and 1

use rand::Rng; // 0.8.0

fn main() {
    // Generate random number in the range [0, 99]
    let num = rand::thread_rng().gen_range(0..100);
    println!("{}", num);
}
Posted by: Guest on February-24-2021

Code answers related to "rust random float between 0 and 1"

Browse Popular Code Answers by Language