num-traits
num-traits copied to clipboard
Add CheckedNumOps
Working with numerics in num-traits is biased towards using the standard traits, which is generally good. However, checked arithmetic is lacking a unifying trait (like NumOps). This PR adds that.
This trait should theoretically be a supertrait of PrimInt. However, this trait (like NumOps: Rem), requires CheckedRem. PrimInt does not currently require that, meaning that this would be a breaking change. (PrimInt: CheckedNumOps for a future release?)