Skip to content

Poisson distribution falls into an infinite loop for parameter λ=∞ #1290

@Thopic

Description

@Thopic

When the parameter of the Poisson distribution is set to f64::INFINITY the sample function doesn't panic but instead loop and never stops. For example:

use rand_distr::{Poisson, Distribution};
fn main() {
    let lambda = f64::INFINITY;
    let poi = Poisson::new(lambda).unwrap();
    println!("{:?}", poi.sample(&mut rand::thread_rng()));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions