Skip to content

Commit

Permalink
Rewrite some *= for clarity
Browse files Browse the repository at this point in the history
clippy complained about this and thought it was unintended
  • Loading branch information
FreezyLemon authored and YeungOnion committed Apr 21, 2024
1 parent 27e28ec commit 594bced
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/distribution/gamma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ pub fn sample_unchecked<R: Rng + ?Sized>(rng: &mut R, shape: f64, rate: f64) ->
};
}

v *= v * v;
x *= x;
v = v * v * v;
x = x * x;
let u: f64 = rng.gen();
if u < 1.0 - 0.0331 * x * x || u.ln() < 0.5 * x + d * (1.0 - v + v.ln()) {
return afix * d * v / rate;
Expand Down

0 comments on commit 594bced

Please sign in to comment.