wrapping_add_signed

Function wrapping_add_signed 

Source
pub open spec fn wrapping_add_signed(x: u128, y: i128) -> u128
Expand description
{
    if x + y > <u128>::MAX {
        (x + y - 0x1_0000_0000_0000_0000_0000_0000_0000_0000) as u128
    } else if x + y < 0 {
        (x + y + 0x1_0000_0000_0000_0000_0000_0000_0000_0000) as u128
    } else {
        (x + y) as u128
    }
}