| 1119 | |
| 1120 | template <typename Decimal, typename Real> |
| 1121 | void CheckDecimalToRealWithinOneULP(const std::string& decimal_value, int32_t scale, |
| 1122 | Real expected) { |
| 1123 | Decimal dec(decimal_value); |
| 1124 | Real actual = dec.template ToReal<Real>(scale); |
| 1125 | ASSERT_TRUE(actual == expected || actual == std::nextafter(expected, expected + 1) || |
| 1126 | actual == std::nextafter(expected, expected - 1)) |
| 1127 | << "Decimal value: " << decimal_value << ", scale: " << scale |
| 1128 | << ", expected: " << expected << ", actual: " << actual; |
| 1129 | } |
| 1130 | |
| 1131 | template <typename Decimal, typename Real> |
| 1132 | void CheckDecimalToRealWithinEpsilon(const std::string& decimal_value, int32_t scale, |
nothing calls this directly
no outgoing calls
no test coverage detected