• Home
  • Raw
  • Download

Lines Matching refs:max

57     return SrcLimits::max();  in GetMaxConvertibleToFloat()
58 Src max = SrcLimits::max() / 2 + (SrcLimits::is_integer ? 1 : 0); in GetMaxConvertibleToFloat() local
59 while (max != static_cast<Src>(static_cast<Dst>(max))) { in GetMaxConvertibleToFloat()
60 max /= 2; in GetMaxConvertibleToFloat()
62 return static_cast<Dst>(max); in GetMaxConvertibleToFloat()
93 CheckedNumeric<Dst>(DstLimits::max()) + -1); in TestSpecializedArithmetic()
98 CheckedNumeric<Dst>(-DstLimits::max()) + -DstLimits::max()); in TestSpecializedArithmetic()
106 CheckedNumeric<Dst>(DstLimits::max()) - -DstLimits::max()); in TestSpecializedArithmetic()
109 CheckedNumeric<Dst>(-DstLimits::max()) - DstLimits::max()); in TestSpecializedArithmetic()
124 TEST_EXPECTED_VALUE(1, CheckedNumeric<Dst>(DstLimits::max()) % 2); in TestSpecializedArithmetic()
164 TEST_EXPECTED_VALUE(1, CheckedNumeric<Dst>(DstLimits::max()) % 2); in TestSpecializedArithmetic()
189 CheckedNumeric<Dst>(DstLimits::max()) + 1); in TestSpecializedArithmetic()
192 CheckedNumeric<Dst>(-DstLimits::max()) + -DstLimits::max()); in TestSpecializedArithmetic()
196 CheckedNumeric<Dst>(DstLimits::max()) - -DstLimits::max()); in TestSpecializedArithmetic()
199 CheckedNumeric<Dst>(-DstLimits::max()) - DstLimits::max()); in TestSpecializedArithmetic()
215 CheckedNumeric<Dst>(CheckedNumeric<Dst>(DstLimits::max()) * in TestArithmetic()
216 DstLimits::max()).IsValid()); in TestArithmetic()
220 CheckedNumeric<Dst>(CheckedNumeric<Dst>(DstLimits::max()) * in TestArithmetic()
221 DstLimits::max()).ValueOrDefault(1)); in TestArithmetic()
249 TEST_EXPECTED_VALUE(static_cast<Dst>(DstLimits::max() * -1), in TestArithmetic()
250 -CheckedNumeric<Dst>(DstLimits::max())); in TestArithmetic()
255 TEST_EXPECTED_VALUE(DstLimits::max(), in TestArithmetic()
256 CheckedNumeric<Dst>(DstLimits::max()).Abs()); in TestArithmetic()
265 RANGE_OVERFLOW, CheckedNumeric<Dst>(DstLimits::max()) + DstLimits::max()); in TestArithmetic()
272 CheckedNumeric<Dst>(DstLimits::max()) - 1); in TestArithmetic()
282 RANGE_OVERFLOW, CheckedNumeric<Dst>(DstLimits::max()) * DstLimits::max()); in TestArithmetic()
289 TEST_EXPECTED_VALUE(DstLimits::max() / 2, in TestArithmetic()
290 CheckedNumeric<Dst>(DstLimits::max()) / 2); in TestArithmetic()
352 const CheckedNumeric<Dst> checked_dst = SrcLimits::max(); in Test()
357 TEST_EXPECTED_VALIDITY(RANGE_VALID, SrcLimits::max() * checked_dst); in Test()
360 TEST_EXPECTED_VALIDITY(RANGE_OVERFLOW, SrcLimits::max() * checked_dst); in Test()
367 TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::max()); in Test()
370 TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::max() * static_cast<Src>(-1)); in Test()
393 TEST_EXPECTED_VALIDITY(RANGE_OVERFLOW, checked_dst + SrcLimits::max()); in Test()
395 TEST_EXPECTED_VALIDITY(RANGE_UNDERFLOW, checked_dst - SrcLimits::max()); in Test()
397 TEST_EXPECTED_RANGE(RANGE_OVERFLOW, SrcLimits::max()); in Test()
400 TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, SrcLimits::max() * -1); in Test()
408 static_cast<Src>(DstLimits::max())); in Test()
410 TEST_EXPECTED_RANGE(RANGE_VALID, static_cast<Src>(DstLimits::max())); in Test()
439 TEST_EXPECTED_VALUE(SrcLimits::max(), checked_dst + SrcLimits::max()); in Test()
441 TEST_EXPECTED_VALIDITY(RANGE_UNDERFLOW, checked_dst + -SrcLimits::max()); in Test()
444 TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::max()); in Test()
463 TEST_EXPECTED_VALIDITY(RANGE_OVERFLOW, checked_dst + SrcLimits::max()); in Test()
465 TEST_EXPECTED_VALIDITY(RANGE_UNDERFLOW, checked_dst + -SrcLimits::max()); in Test()
467 TEST_EXPECTED_RANGE(RANGE_OVERFLOW, SrcLimits::max()); in Test()
471 TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, SrcLimits::max() * -1); in Test()
478 static_cast<Src>(DstLimits::max())); in Test()
480 TEST_EXPECTED_RANGE(RANGE_VALID, static_cast<Src>(DstLimits::max())); in Test()
505 TEST_EXPECTED_VALIDITY(RANGE_OVERFLOW, checked_dst + SrcLimits::max()); in Test()
509 TEST_EXPECTED_RANGE(RANGE_OVERFLOW, SrcLimits::max()); in Test()
619 double double_large = numeric_limits<double>::max(); in TEST()
621 double double_large_int = numeric_limits<int>::max(); in TEST()
640 EXPECT_TRUE(IsValueNegative(-numeric_limits<double>::max())); in TEST()
645 EXPECT_FALSE(IsValueNegative(numeric_limits<int>::max())); in TEST()
646 EXPECT_FALSE(IsValueNegative(numeric_limits<unsigned>::max())); in TEST()
647 EXPECT_FALSE(IsValueNegative(numeric_limits<double>::max())); in TEST()
664 EXPECT_EQ(saturated_cast<int>(double_large), numeric_limits<int>::max()); in TEST()
668 EXPECT_EQ(numeric_limits<int>::max(), saturated_cast<int>(double_large_int)); in TEST()
777 CheckedNumeric<int> too_large = std::numeric_limits<int>::max(); in TEST()