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

Function AddFastPath

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

Adjust x and y to the same scale, and add them.

Source from the content-addressed store, hash-verified

48
49/// Adjust x and y to the same scale, and add them.
50static BasicDecimal128 AddFastPath(const BasicDecimalScalar128& x,
51 const BasicDecimalScalar128& y, int32_t out_scale) {
52 auto higher_scale = std::max(x.scale(), y.scale());
53
54 auto x_scaled = CheckAndIncreaseScale(x.value(), higher_scale - x.scale());
55 auto y_scaled = CheckAndIncreaseScale(y.value(), higher_scale - y.scale());
56 return x_scaled + y_scaled;
57}
58
59/// Add x and y, caller has ensured there can be no overflow.
60static BasicDecimal128 AddNoOverflow(const BasicDecimalScalar128& x,

Callers 3

BuildAddMethod · 0.85
AddNoOverflowFunction · 0.85
AddFunction · 0.85

Calls 3

CheckAndIncreaseScaleFunction · 0.85
scaleMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected