MCPcopy Create free account
hub / github.com/apache/arrow / CheckDecimalToRealWithinOneULP

Function CheckDecimalToRealWithinOneULP

cpp/src/arrow/util/decimal_test.cc:1121–1129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1119
1120template <typename Decimal, typename Real>
1121void 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
1131template <typename Decimal, typename Real>
1132void CheckDecimalToRealWithinEpsilon(const std::string& decimal_value, int32_t scale,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected