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

Function AddNoOverflow

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

Add x and y, caller has ensured there can be no overflow.

Source from the content-addressed store, hash-verified

58
59/// Add x and y, caller has ensured there can be no overflow.
60static BasicDecimal128 AddNoOverflow(const BasicDecimalScalar128& x,
61 const BasicDecimalScalar128& y, int32_t out_scale) {
62 auto higher_scale = std::max(x.scale(), y.scale());
63 auto sum = AddFastPath(x, y, out_scale);
64 return CheckAndReduceScale(sum, higher_scale - out_scale);
65}
66
67/// Both x_value and y_value must be >= 0
68static BasicDecimal128 AddLargePositive(const BasicDecimalScalar128& x,

Callers 1

AddFunction · 0.85

Calls 3

AddFastPathFunction · 0.85
CheckAndReduceScaleFunction · 0.85
scaleMethod · 0.45

Tested by

no test coverage detected