pub fn checked_next_multiple_of(a: usize, b: usize) -> Option<usize>
Expand description
Returns smallest value that is greater than or equal to a
and multiple of b
,
or None
if b
is zero or operation would overflow.
- This function is available as
usize::checked_next_multiple_of
in nightly Rust.
ยงExamples
use reed_solomon_16::engine;
assert_eq!(engine::checked_next_multiple_of(20, 10), Some(20));
assert_eq!(engine::checked_next_multiple_of(27, 10), Some(30));