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

Function ToInt64

cpp/src/gandiva/precompiled/decimal_ops.cc:714–721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

712}
713
714int64_t ToInt64(const BasicDecimalScalar128& in, bool* overflow) {
715 auto rounded = RoundWithPositiveScale(in, in.precision(), 0 /*scale*/,
716 RoundType::kRoundTypeHalfRoundUp, overflow);
717 DECIMAL_OVERFLOW_IF((rounded > std::numeric_limits<int64_t>::max()) ||
718 (rounded < std::numeric_limits<int64_t>::min()),
719 overflow);
720 return static_cast<int64_t>(rounded.low_bits());
721}
722
723} // namespace decimalops
724} // namespace gandiva

Callers 3

TEST_FFunction · 0.85
castBIGINT_decimal128Function · 0.85
truncate_int64_int32Function · 0.85

Calls 2

RoundWithPositiveScaleFunction · 0.85
precisionMethod · 0.45

Tested by 1

TEST_FFunction · 0.68