avhz / RustQuant

Rust library for quantitative finance.
https://docs.rs/RustQuant
Apache License 2.0
969 stars 105 forks source link

Inconsistency between code and documentation #203

Closed YichiZhang0613 closed 4 months ago

YichiZhang0613 commented 4 months ago

There is inconsistency between code and documentation In RustQuant/src/math/distributions/exponential.rs, the documentation requires lambda <= 0.0, while the code checks assert!(lambda > 0.0);

/// # Panics
    ///
    /// Panics if lambda is greater than 0.0
    #[must_use]
    pub fn new(lambda: f64) -> Self {
        assert!(lambda > 0.0);

        Self { lambda }
    }
avhz commented 4 months ago

Thanks for spotting. Fixed in commit commit 9f102b30c9d3edf204b3bac3783f78627441d660