From 298c6fd516839dafeca30be98d81ea884a8dc034 Mon Sep 17 00:00:00 2001 From: Orion Yeung <11580988+orionyeung001@users.noreply.github.com> Date: Tue, 16 Apr 2024 18:49:44 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20return=20None=20for=20Gamma::mode=20when?= =?UTF-8?q?=20=CE=B1=20<=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/distribution/gamma.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/distribution/gamma.rs b/src/distribution/gamma.rs index 9c497487..4e7dfd49 100644 --- a/src/distribution/gamma.rs +++ b/src/distribution/gamma.rs @@ -236,15 +236,15 @@ impl Mode> for Gamma { /// # Formula /// /// ```text - /// max{(α - 1) / β, 0} + /// (α - 1) / β, where α > 1 /// ``` /// /// where `α` is the shape and `β` is the rate fn mode(&self) -> Option { - if self.shape > 1.0 { + if self.shape >= 1.0 { Some((self.shape - 1.0) / self.rate) } else { - Some(0.0) + None } } }