pitrou commented on code in PR #43957:
URL: https://github.com/apache/arrow/pull/43957#discussion_r1766941181
##########
cpp/src/arrow/util/decimal_internal.h:
##########
@@ -442,8 +516,9 @@ struct RealTraits<float> {
static constexpr float two_to_192(float x) { return x == 0 ? 0 : kFloatInf; }
static constexpr int kMantissaBits = 24;
- // ceil(log10(2 ^ kMantissaBits))
- static constexpr int kMantissaDigits = 8;
+ // log10(2 ^ kMantissaBits) ~= 7.2, let's be conservative to ensure more
accuracy
+ // with our conversions for Decimal values
Review Comment:
As I mentioned elsewhere, float->Decimal32 probably needs to fall back on
the approx algorithm.
I'm a bit surprised for Decimal64, though. Is the RoundedRightShift right?
--
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]