Lines Matching refs:max

56     return SrcLimits::max();  in GetMaxConvertibleToFloat()
57 Src max = SrcLimits::max() / 2 + (SrcLimits::is_integer ? 1 : 0); in GetMaxConvertibleToFloat() local
58 while (max != static_cast<Src>(static_cast<Dst>(max))) { in GetMaxConvertibleToFloat()
59 max /= 2; in GetMaxConvertibleToFloat()
61 return static_cast<Dst>(max); in GetMaxConvertibleToFloat()
92 TEST_EXPECTED_SUCCESS(CheckedNumeric<Dst>(DstLimits::max()) + -1); in TestSpecializedArithmetic()
94 TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(-DstLimits::max()) + in TestSpecializedArithmetic()
95 -DstLimits::max()); in TestSpecializedArithmetic()
99 TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::max()) - in TestSpecializedArithmetic()
100 -DstLimits::max()); in TestSpecializedArithmetic()
101 TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(-DstLimits::max()) - in TestSpecializedArithmetic()
102 DstLimits::max()); in TestSpecializedArithmetic()
115 TEST_EXPECTED_VALUE(1, CheckedNumeric<Dst>(DstLimits::max()) % 2); in TestSpecializedArithmetic()
150 TEST_EXPECTED_VALUE(1, CheckedNumeric<Dst>(DstLimits::max()) % 2); in TestSpecializedArithmetic()
172 TEST_EXPECTED_SUCCESS(CheckedNumeric<Dst>(DstLimits::max()) + 1); in TestSpecializedArithmetic()
173 TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(-DstLimits::max()) + in TestSpecializedArithmetic()
174 -DstLimits::max()); in TestSpecializedArithmetic()
176 TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::max()) - in TestSpecializedArithmetic()
177 -DstLimits::max()); in TestSpecializedArithmetic()
178 TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(-DstLimits::max()) - in TestSpecializedArithmetic()
179 DstLimits::max()); in TestSpecializedArithmetic()
194 CheckedNumeric<Dst>(CheckedNumeric<Dst>(DstLimits::max()) * in TestArithmetic()
195 DstLimits::max()).IsValid()); in TestArithmetic()
199 CheckedNumeric<Dst>(CheckedNumeric<Dst>(DstLimits::max()) * in TestArithmetic()
200 DstLimits::max()).ValueOrDefault(1)); in TestArithmetic()
228 TEST_EXPECTED_VALUE(static_cast<Dst>(DstLimits::max() * -1), in TestArithmetic()
229 -CheckedNumeric<Dst>(DstLimits::max())); in TestArithmetic()
234 TEST_EXPECTED_VALUE(DstLimits::max(), in TestArithmetic()
235 CheckedNumeric<Dst>(DstLimits::max()).Abs()); in TestArithmetic()
242 TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::max()) + in TestArithmetic()
243 DstLimits::max()); in TestArithmetic()
249 TEST_EXPECTED_SUCCESS(CheckedNumeric<Dst>(DstLimits::max()) - 1); in TestArithmetic()
258 TEST_EXPECTED_FAILURE(CheckedNumeric<Dst>(DstLimits::max()) * in TestArithmetic()
259 DstLimits::max()); in TestArithmetic()
266 TEST_EXPECTED_VALUE(DstLimits::max() / 2, in TestArithmetic()
267 CheckedNumeric<Dst>(DstLimits::max()) / 2); in TestArithmetic()
329 const CheckedNumeric<Dst> checked_dst = SrcLimits::max(); in Test()
334 TEST_EXPECTED_SUCCESS(SrcLimits::max() * checked_dst); in Test()
337 TEST_EXPECTED_FAILURE(SrcLimits::max() * checked_dst); in Test()
344 TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::max()); in Test()
347 TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::max() * static_cast<Src>(-1)); in Test()
370 TEST_EXPECTED_FAILURE(checked_dst + SrcLimits::max()); in Test()
372 TEST_EXPECTED_FAILURE(checked_dst - SrcLimits::max()); in Test()
374 TEST_EXPECTED_RANGE(RANGE_OVERFLOW, SrcLimits::max()); in Test()
377 TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, SrcLimits::max() * -1); in Test()
385 static_cast<Src>(DstLimits::max())); in Test()
387 TEST_EXPECTED_RANGE(RANGE_VALID, static_cast<Src>(DstLimits::max())); in Test()
416 TEST_EXPECTED_VALUE(SrcLimits::max(), checked_dst + SrcLimits::max()); in Test()
418 TEST_EXPECTED_FAILURE(checked_dst + -SrcLimits::max()); in Test()
421 TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::max()); in Test()
440 TEST_EXPECTED_FAILURE(checked_dst + SrcLimits::max()); in Test()
442 TEST_EXPECTED_FAILURE(checked_dst + -SrcLimits::max()); in Test()
444 TEST_EXPECTED_RANGE(RANGE_OVERFLOW, SrcLimits::max()); in Test()
448 TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, SrcLimits::max() * -1); in Test()
455 static_cast<Src>(DstLimits::max())); in Test()
457 TEST_EXPECTED_RANGE(RANGE_VALID, static_cast<Src>(DstLimits::max())); in Test()
482 TEST_EXPECTED_FAILURE(checked_dst + SrcLimits::max()); in Test()
486 TEST_EXPECTED_RANGE(RANGE_OVERFLOW, SrcLimits::max()); in Test()
596 double double_large = numeric_limits<double>::max(); in TEST()
598 double double_large_int = numeric_limits<int>::max(); in TEST()
617 EXPECT_TRUE(IsValueNegative(-numeric_limits<double>::max())); in TEST()
622 EXPECT_FALSE(IsValueNegative(numeric_limits<int>::max())); in TEST()
623 EXPECT_FALSE(IsValueNegative(numeric_limits<unsigned>::max())); in TEST()
624 EXPECT_FALSE(IsValueNegative(numeric_limits<double>::max())); in TEST()
641 EXPECT_EQ(saturated_cast<int>(double_large), numeric_limits<int>::max()); in TEST()
645 EXPECT_EQ(numeric_limits<int>::max(), saturated_cast<int>(double_large_int)); in TEST()
754 CheckedNumeric<int> too_large = std::numeric_limits<int>::max(); in TEST()