reed_solomon_16::engine

Function checked_next_multiple_of

Source
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.

ยง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));