]> git.lizzy.rs Git - rust.git/commit
Add saturating_abs() and saturating_neg() functions to signed integer types
authorTobias Rapp <t.rapp@noa-archive.com>
Wed, 17 Apr 2019 13:28:57 +0000 (15:28 +0200)
committerTobias Rapp <t.rapp@noa-archive.com>
Thu, 25 Apr 2019 15:04:11 +0000 (17:04 +0200)
commit8234ac32bd9002a02d7c70a989a04c2278acf78d
tree2f08c996d1462af6aba59cba65aa96eed0190477
parent3bee49f42b6dfb039d2a8e59e5181e26531c3c11
Add saturating_abs() and saturating_neg() functions to signed integer types

Similar to wrapping_abs() / wrapping_neg() functions but saturating at
the numeric bounds instead of wrapping around. Complements the existing
set of functions with saturation mechanics.
src/libcore/num/mod.rs