Skip to main content

saturating_add

Function saturating_add 

Source
pub fn saturating_add(one: i16, two: i16) -> i16
Expand description

Add two samples, clipping at the ends of the range.

i16::saturating_add already does exactly this. It is worth having a named function anyway, because the mistake this prevents is not writing the wrong addition — it is writing +.