Skip to content

Commit

Permalink
Merge pull request #16 from ShenMian/fix/clippy
Browse files Browse the repository at this point in the history
refactor(lib): replace manual clamp with f32::clamp
  • Loading branch information
aMarcireau authored Jan 17, 2025
2 parents 0941abe + f648a04 commit 9e9931e
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,13 +698,7 @@ impl Constants {
}

// (E + ω)ᵢ₊₁ = (E + ω)ᵢ + Δ(E + ω)ᵢ|[-0.95, 0.95]
ew += if delta < -0.95 {
-0.95
} else if delta > 0.95 {
0.95
} else {
delta
};
ew += delta.clamp(-0.95, 0.95);
}

// p₃₉ = aₓₙ² + aᵧₙ²
Expand Down

0 comments on commit 9e9931e

Please sign in to comment.