mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 12:36:35 +03:00
0e45047e81
add `is_multiple_of` for unsigned integer types tracking issue: https://github.com/rust-lang/rust/issues/128101 This adds the `.is_multiple_of` method on unsigned integers. Returns `true` if `self` is an integer multiple of `rhs`, and false otherwise. This function is equivalent to `self % rhs == 0`, except that it will not panic for `rhs == 0`. Instead, `0.is_multiple_of(0) == true`, and for any non-zero `n`, `n.is_multiple_of(0) == false`.