Lines Matching refs:SrcLimits
50 typedef numeric_limits<Src> SrcLimits; in GetMaxConvertibleToFloat() typedef
51 static_assert(SrcLimits::is_specialized, "Source must be numeric."); in GetMaxConvertibleToFloat()
55 if (SrcLimits::digits <= DstLimits::digits && in GetMaxConvertibleToFloat()
57 return SrcLimits::max(); in GetMaxConvertibleToFloat()
58 Src max = SrcLimits::max() / 2 + (SrcLimits::is_integer ? 1 : 0); in GetMaxConvertibleToFloat()
339 typedef numeric_limits<Src> SrcLimits; in Test() typedef
342 static_assert((DstLimits::is_iec559 && SrcLimits::is_integer) || in Test()
344 (!(DstLimits::is_integer && SrcLimits::is_iec559) && in Test()
346 ((SrcLimits::is_signed == DstLimits::is_signed && in Test()
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()
369 if (SrcLimits::is_iec559) { in Test()
370 TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::max() * static_cast<Src>(-1)); in Test()
371 TEST_EXPECTED_RANGE(RANGE_OVERFLOW, SrcLimits::infinity()); in Test()
372 TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, SrcLimits::infinity() * -1); in Test()
373 TEST_EXPECTED_RANGE(RANGE_INVALID, SrcLimits::quiet_NaN()); in Test()
376 TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::min()); in Test()
384 typedef numeric_limits<Src> SrcLimits; in Test() typedef
386 static_assert(SrcLimits::is_signed == DstLimits::is_signed, in Test()
389 (DstLimits::is_integer && SrcLimits::is_iec559), 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()
399 if (SrcLimits::is_iec559) { in Test()
400 TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, SrcLimits::max() * -1); in Test()
402 TEST_EXPECTED_RANGE(RANGE_OVERFLOW, SrcLimits::infinity()); in Test()
403 TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, SrcLimits::infinity() * -1); in Test()
404 TEST_EXPECTED_RANGE(RANGE_INVALID, SrcLimits::quiet_NaN()); in Test()
406 if (SrcLimits::digits < DstLimits::digits) { in Test()
417 } else if (SrcLimits::is_signed) { in Test()
419 TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, SrcLimits::min()); in Test()
423 TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::min()); in Test()
431 typedef numeric_limits<Src> SrcLimits; in Test() typedef
435 static_assert(SrcLimits::is_signed, "Source must be signed"); 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()
443 TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, SrcLimits::min()); in Test()
444 TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::max()); in Test()
453 typedef numeric_limits<Src> SrcLimits; in Test() typedef
455 static_assert((DstLimits::is_integer && SrcLimits::is_iec559) || in Test()
458 static_assert(SrcLimits::is_signed, "Source must be signed."); 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()
470 if (SrcLimits::is_iec559) { in Test()
471 TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, SrcLimits::max() * -1); in Test()
472 TEST_EXPECTED_RANGE(RANGE_OVERFLOW, SrcLimits::infinity()); in Test()
473 TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, SrcLimits::infinity() * -1); in Test()
474 TEST_EXPECTED_RANGE(RANGE_INVALID, SrcLimits::quiet_NaN()); in Test()
476 if (SrcLimits::digits < DstLimits::digits) { in Test()
488 TEST_EXPECTED_RANGE(RANGE_UNDERFLOW, SrcLimits::min()); in Test()
496 typedef numeric_limits<Src> SrcLimits; in Test() typedef
500 static_assert(!SrcLimits::is_signed, "Source must be unsigned."); in Test()
505 TEST_EXPECTED_VALIDITY(RANGE_OVERFLOW, checked_dst + SrcLimits::max()); in Test()
506 TEST_EXPECTED_VALUE(SrcLimits::min(), checked_dst + SrcLimits::min()); in Test()
508 TEST_EXPECTED_RANGE(RANGE_VALID, SrcLimits::min()); in Test()
509 TEST_EXPECTED_RANGE(RANGE_OVERFLOW, SrcLimits::max()); in Test()