Adjust x and y to the same scale, and add them.
| 48 | |
| 49 | /// Adjust x and y to the same scale, and add them. |
| 50 | static 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. |
| 60 | static BasicDecimal128 AddNoOverflow(const BasicDecimalScalar128& x, |
no test coverage detected