Rollup merge of #127122 - TDecking:div_ceil, r=Nilstrieb
Remove uneccessary condition in `div_ceil` Previously, `div_ceil` for unsigned integers had a `rhs > 0` for rounding. That condition however is always fulfilled, since `rhs == 0` would mean a division by zero earlier.
This commit is contained in:
commit
c79e08d3a6
1 changed files with 1 additions and 1 deletions
|
@ -2726,7 +2726,7 @@ macro_rules! uint_impl {
|
||||||
pub const fn div_ceil(self, rhs: Self) -> Self {
|
pub const fn div_ceil(self, rhs: Self) -> Self {
|
||||||
let d = self / rhs;
|
let d = self / rhs;
|
||||||
let r = self % rhs;
|
let r = self % rhs;
|
||||||
if r > 0 && rhs > 0 {
|
if r > 0 {
|
||||||
d + 1
|
d + 1
|
||||||
} else {
|
} else {
|
||||||
d
|
d
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue