pitrou commented on code in PR #43957:
URL: https://github.com/apache/arrow/pull/43957#discussion_r1766971607
##########
cpp/src/arrow/util/decimal.cc:
##########
@@ -156,7 +162,9 @@ struct DecimalRealConversion : public
BaseDecimalRealConversion {
// NOTE: if `precision` is the full precision then the algorithm will
// lose the last digit. If `precision` is almost the full precision,
// there can be an off-by-one error due to rounding.
- const int mul_step = std::max(1, kMaxPrecision - precision);
+ constexpr int is_dec32_or_dec64 =
+ DecimalType::kByteWidth <= BasicDecimal64::kByteWidth;
+ const int mul_step = std::max(1, kMaxPrecision - precision -
is_dec32_or_dec64);
Review Comment:
That said, if you don't want to debug these now, I would favor removing the
hacks, adding temporary workarounds in the tests, and opening an issue together
with value(s) reproducing the problem. Then this can be investigated (by you,
me or @bkietz for example :-)).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]