3 ms·
Rust does "computer" (silently overflowing) arithmetic by default. Saturating[0] and checked[1] are optionally available but require converting to methods (and
by masklinn 12y ago
Rust does "computer" (silently overflowing) arithmetic by default. Saturating[0] and checked[1] are optionally available but require converting to methods (and some other changes for checked as it returns an Option)
[0] http://doc.rust-lang.org/std/num/trait.Int.html#tymethod.saturating_add http://doc.rust-lang.org/std/num/trait.Int.html#tymethod.sat...
[1] http://doc.rust-lang.org/std/num/trait.Int.html#tymethod.checked_add http://doc.rust-lang.org/std/num/trait.Int.html#tymethod.che...