Function vstd::atomic::wrapping_add_i16

source ·
pub open spec fn wrapping_add_i16(a: int, b: int) -> int
Expand description
{
    if a + b > (<i16>::MAX as int) {
        a + b - ((<i16>::MAX as int) - (<i16>::MIN as int) + 1)
    } else if a + b < (<i16>::MIN as int) {
        a + b + ((<i16>::MAX as int) - (<i16>::MIN as int) + 1)
    } else {
        a + b
    }
}