#![allow(dead_code, deprecated, unused_variables, unused_mut)] #![feature(bigint_helper_methods)] fn main() { assert_eq!(5i32.carrying_mul_add(- 2, 0, 0), (4294967286, - 1)); assert_eq!(5i32.carrying_mul_add(- 2, 10, 10), (10, 0)); assert_eq!(1_000_000_000i32.carrying_mul_add(- 10, 0, 0), (2884901888, - 3)); assert_eq!(1_000_000_000i32.carrying_mul_add(- 10, 10, 10), (2884901908, - 3)); assert_eq!( i8::MAX.carrying_mul_add(i8::MAX, i8::MAX, i8::MAX), (u8::MAX, i8::MAX / 2) ); }