Searched refs:ClampedNumeric (Results 1 – 5 of 5) sorted by relevance
19 class ClampedNumeric {26 constexpr ClampedNumeric() : value_(0) {} in ClampedNumeric() function30 constexpr ClampedNumeric(const ClampedNumeric<Src>& rhs) in ClampedNumeric() function34 friend class ClampedNumeric; variable39 constexpr ClampedNumeric(Src value) // NOLINT(runtime/explicit) in ClampedNumeric() function47 constexpr ClampedNumeric( in ClampedNumeric() function54 constexpr ClampedNumeric<typename UnderlyingType<Dst>::type> Cast() const { in Cast()60 constexpr ClampedNumeric& operator+=(const Src rhs);62 constexpr ClampedNumeric& operator-=(const Src rhs);64 constexpr ClampedNumeric& operator*=(const Src rhs);[all …]
13 * `clamped_math.h` contains the `ClampedNumeric` template class and26 * `StrictNumeric` coerces to `ClampedNumeric` and `CheckedNumeric`27 * `ClampedNumeric` coerces to `CheckedNumeric`81 Both the `StrictNumeric` and `ClampedNumeric` types provide well defined126 conditions. The `ClampedNumeric` template addresses this by providing129 Here's an example of using a `ClampedNumeric` to calculate an operation142 The `ClampedNumeric` type is not "sticky", which means the saturation is not148 ClampedNumeric<int> value = INT_MAX;320 ## ClampedNumeric<> in clamped_math.h322 `ClampedNumeric<>` implements all the logic and operators for clamped[all …]
598 class ClampedNumeric;623 struct UnderlyingType<ClampedNumeric<T>> {
120 U GetNumericValueForTest(const ClampedNumeric<U>& src) { in GetNumericValueForTest()159 constexpr T GetValue(const ClampedNumeric<T>& src) { in GetValue()164 constexpr T GetValueAsDest(const ClampedNumeric<U>& src) { in GetValueAsDest()216 -ClampedNumeric<Dst>(DstLimits::lowest())); in TestSpecializedArithmetic()218 ClampedNumeric<Dst>(DstLimits::lowest()).Abs()); in TestSpecializedArithmetic()219 TEST_EXPECTED_VALUE(1, ClampedNumeric<Dst>(-1).Abs()); in TestSpecializedArithmetic()229 ClampedNumeric<Dst>(DstLimits::max()) + -1); in TestSpecializedArithmetic()231 ClampedNumeric<Dst>(DstLimits::lowest()) + -1); in TestSpecializedArithmetic()234 ClampedNumeric<Dst>(DstLimits::lowest()) + DstLimits::lowest()); in TestSpecializedArithmetic()244 ClampedNumeric<Dst>(DstLimits::lowest()) - 1); in TestSpecializedArithmetic()[all …]
599 class ClampedNumeric;624 struct UnderlyingType<ClampedNumeric<T>> {