Implement CheckedNumeric::UnsignedAbs()
commiteaf375f8db272522afff267fe92fa6b27012a78f
authorjschuh <jschuh@chromium.org>
Thu, 17 Sep 2015 01:04:28 +0000 (16 18:04 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 17 Sep 2015 01:04:58 +0000 (17 01:04 +0000)
treedf8f4269d3bedfac8ca476efa59ca0fecf103033
parent14481cf7c2e1a74e1f0be7482640804555776af6
Implement CheckedNumeric::UnsignedAbs()

This covers some corner cases where we want an equivalent to
std::abs() for signed integers, but we want it to convert to
an unsigned type of the same width and properly handle the
value of signed min().

Review URL: https://codereview.chromium.org/1346753002

Cr-Commit-Position: refs/heads/master@{#349300}
base/numerics/safe_math.h
base/numerics/safe_math_impl.h
base/numerics/safe_numerics_unittest.cc