Missing traits for checked arithmetic

The stdlib is intentionally short of a whole bunch of commonly-requested traits for math. There's no trait for the additive identity element either, for example.

The general answer for this is that you want num_traits - Rust, which has CheckedAdd and friends, as well as many others.

3 Likes