Lines Matching refs:DstLimits

49   typedef numeric_limits<Dst> DstLimits;  in GetMaxConvertibleToFloat()  typedef
52 static_assert(DstLimits::is_specialized, "Destination must be numeric."); in GetMaxConvertibleToFloat()
53 CHECK(DstLimits::is_iec559); in GetMaxConvertibleToFloat()
55 if (SrcLimits::digits <= DstLimits::digits && in GetMaxConvertibleToFloat()
85 typedef numeric_limits<Dst> DstLimits; in TestSpecializedArithmetic() typedef
87 -CheckedNumeric<Dst>(DstLimits::min())); in TestSpecializedArithmetic()
89 CheckedNumeric<Dst>(DstLimits::min()).Abs()); in TestSpecializedArithmetic()
93 CheckedNumeric<Dst>(DstLimits::max()) + -1); in TestSpecializedArithmetic()
95 CheckedNumeric<Dst>(DstLimits::min()) + -1); in TestSpecializedArithmetic()
98 CheckedNumeric<Dst>(-DstLimits::max()) + -DstLimits::max()); in TestSpecializedArithmetic()
101 CheckedNumeric<Dst>(DstLimits::min()) - 1); in TestSpecializedArithmetic()
103 CheckedNumeric<Dst>(DstLimits::min()) - -1); in TestSpecializedArithmetic()
106 CheckedNumeric<Dst>(DstLimits::max()) - -DstLimits::max()); in TestSpecializedArithmetic()
109 CheckedNumeric<Dst>(-DstLimits::max()) - DstLimits::max()); in TestSpecializedArithmetic()
112 CheckedNumeric<Dst>(DstLimits::min()) * 2); in TestSpecializedArithmetic()
115 CheckedNumeric<Dst>(DstLimits::min()) / -1); in TestSpecializedArithmetic()
123 TEST_EXPECTED_VALUE(0, CheckedNumeric<Dst>(DstLimits::min()) % 2); in TestSpecializedArithmetic()
124 TEST_EXPECTED_VALUE(1, CheckedNumeric<Dst>(DstLimits::max()) % 2); in TestSpecializedArithmetic()
141 typedef numeric_limits<Dst> DstLimits; in TestSpecializedArithmetic() typedef
142 TEST_EXPECTED_VALIDITY(RANGE_VALID, -CheckedNumeric<Dst>(DstLimits::min())); in TestSpecializedArithmetic()
144 CheckedNumeric<Dst>(DstLimits::min()).Abs()); in TestSpecializedArithmetic()
146 CheckedNumeric<Dst>(DstLimits::min()) + -1); in TestSpecializedArithmetic()
148 CheckedNumeric<Dst>(DstLimits::min()) - 1); in TestSpecializedArithmetic()
149 TEST_EXPECTED_VALUE(0, CheckedNumeric<Dst>(DstLimits::min()) * 2); in TestSpecializedArithmetic()
152 CheckedNumeric<Dst>(DstLimits::min()).UnsignedAbs()); in TestSpecializedArithmetic()
163 TEST_EXPECTED_VALUE(0, CheckedNumeric<Dst>(DstLimits::min()) % 2); in TestSpecializedArithmetic()
164 TEST_EXPECTED_VALUE(1, CheckedNumeric<Dst>(DstLimits::max()) % 2); in TestSpecializedArithmetic()
179 typedef numeric_limits<Dst> DstLimits; in TestSpecializedArithmetic() typedef
180 TEST_EXPECTED_VALIDITY(RANGE_VALID, -CheckedNumeric<Dst>(DstLimits::min())); in TestSpecializedArithmetic()
183 CheckedNumeric<Dst>(DstLimits::min()).Abs()); in TestSpecializedArithmetic()
187 CheckedNumeric<Dst>(DstLimits::min()) + -1); 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()
202 CheckedNumeric<Dst>(DstLimits::min()) * 2); in TestSpecializedArithmetic()
211 typedef numeric_limits<Dst> DstLimits; in TestArithmetic() typedef
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()
263 CheckedNumeric<Dst>(DstLimits::min()) + 1); 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()
287 TEST_EXPECTED_VALUE(DstLimits::min() / 2, in TestArithmetic()
288 CheckedNumeric<Dst>(DstLimits::min()) / 2); in TestArithmetic()
289 TEST_EXPECTED_VALUE(DstLimits::max() / 2, in TestArithmetic()
290 CheckedNumeric<Dst>(DstLimits::max()) / 2); in TestArithmetic()
340 typedef numeric_limits<Dst> DstLimits; 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()
349 (DstLimits::is_signed && sizeof(Dst) > sizeof(Src)))), in Test()
385 typedef numeric_limits<Dst> DstLimits; in Test() typedef
386 static_assert(SrcLimits::is_signed == DstLimits::is_signed, in Test()
389 (DstLimits::is_integer && SrcLimits::is_iec559), in Test()
405 if (DstLimits::is_integer) { in Test()
406 if (SrcLimits::digits < DstLimits::digits) { in Test()
408 static_cast<Src>(DstLimits::max())); in Test()
410 TEST_EXPECTED_RANGE(RANGE_VALID, static_cast<Src>(DstLimits::max())); in Test()
415 TEST_EXPECTED_RANGE(RANGE_VALID, static_cast<Src>(DstLimits::min())); in Test()
432 typedef numeric_limits<Dst> DstLimits; in Test() typedef
436 static_assert(!DstLimits::is_signed, "Destination must be unsigned"); in Test()
454 typedef numeric_limits<Dst> DstLimits; in Test() typedef
455 static_assert((DstLimits::is_integer && SrcLimits::is_iec559) || in Test()
459 static_assert(!DstLimits::is_signed, "Destination must be unsigned."); in Test()
475 if (DstLimits::is_integer) { in Test()
476 if (SrcLimits::digits < DstLimits::digits) { in Test()
478 static_cast<Src>(DstLimits::max())); in Test()
480 TEST_EXPECTED_RANGE(RANGE_VALID, static_cast<Src>(DstLimits::max())); in Test()
485 TEST_EXPECTED_RANGE(RANGE_VALID, static_cast<Src>(DstLimits::min())); in Test()
497 typedef numeric_limits<Dst> DstLimits; in Test() typedef
501 static_assert(DstLimits::is_signed, "Destination must be signed."); in Test()