Skip to content

generate_range panics if the upper bound is 0 #24

@tesselode

Description

@tesselode

Example:

use nanorand::{tls_rng, RNG};

fn main() {
    println!("{}", tls_rng().generate_range::<usize>(3, 0));
}

Produces this output:

thread 'main' panicked at 'attempt to calculate the remainder with a divisor of zero', C:\Users\Andrew\.cargo\registry\src\github.zerozr99.workers.dev-1ecc6299db9ec823\nanorand-0.5.2\src\gen.rs:51:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions