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

Function CheckDecimalFromReal

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

Source from the content-addressed store, hash-verified

811
812template <typename Decimal, typename Real>
813void CheckDecimalFromReal(Real real, int32_t precision, int32_t scale,
814 const std::string& expected) {
815 ASSERT_OK_AND_ASSIGN(auto dec, Decimal::FromReal(real, precision, scale));
816 EXPECT_EQ(dec.ToString(scale), expected);
817 const std::string expected_neg = (dec) ? "-" + expected : expected;
818 ASSERT_OK_AND_ASSIGN(dec, Decimal::FromReal(-real, precision, scale));
819 EXPECT_EQ(dec.ToString(scale), expected_neg);
820}
821
822template <typename Decimal, typename Real>
823void CheckDecimalFromRealIntegerString(Real real, int32_t precision, int32_t scale,

Callers

nothing calls this directly

Calls 2

ASSERT_OK_AND_ASSIGNFunction · 0.70
ToStringMethod · 0.45

Tested by

no test coverage detected