| 21 | |
| 22 | template <typename Float> |
| 23 | void TestMaxULPs() |
| 24 | { |
| 25 | for (unsigned int logMaxULPs = 0; logMaxULPs <= 8; ++logMaxULPs) |
| 26 | { |
| 27 | unsigned int const maxULPs = (1 << logMaxULPs) - 1; |
| 28 | for (int base = -1; base <= 1; ++base) |
| 29 | { |
| 30 | for (int dir = -1; dir <= 1; dir += 2) |
| 31 | { |
| 32 | Float const x = base; |
| 33 | Float y = x; |
| 34 | for (unsigned int i = 0; i <= maxULPs; ++i) |
| 35 | { |
| 36 | TEST(AlmostEqualULPs(x, y, maxULPs), (x, y, maxULPs, x - y, dir)); |
| 37 | Float const nextY = NextFloat(y, dir); |
| 38 | TEST_NOT_EQUAL(y, nextY, (i, base, dir)); |
| 39 | y = nextY; |
| 40 | } |
| 41 | TEST(!AlmostEqualULPs(x, y, maxULPs), (x, y, maxULPs, x - y)); |
| 42 | } |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | } // namespace |
| 47 | |
| 48 | UNIT_TEST(round_lround_smoke) |
nothing calls this directly
no test coverage detected