upcast-arithmetic
Utility library for dealing with arithmetic on type limits by upcasting into types with higher limits.
Examples
Without upcast_arithmetic
let a = u8MAX;
let b = 2u8;
let modulo = u8MAX;
let res = % modulo;
assert_eq!;
With upcast_arithmetic
use *;
let a = u8MAX;
let b = 2u8;
let modulo = u8MAX;
let res = a.upcast_add_mod;
assert_eq!;
License: MIT