pitrou commented on code in PR #36667:
URL: https://github.com/apache/arrow/pull/36667#discussion_r1265600622
##########
cpp/src/arrow/util/decimal.cc:
##########
@@ -305,12 +305,39 @@ struct Decimal128RealConversion
}
template <typename Real>
- static Real ToRealPositive(const Decimal128& decimal, int32_t scale) {
+ static Real ToRealPositiveNoSplit(const Decimal128& decimal, int32_t scale) {
Real x =
RealTraits<Real>::two_to_64(static_cast<Real>(decimal.high_bits()));
x += static_cast<Real>(decimal.low_bits());
x *= LargePowerOfTen<Real>(-scale);
return x;
}
+
+ /// An appoximate conversion from Decimal128 to Real that guarantees:
+ /// 1. If the decimal is an integer, the conversion is exact.
Review Comment:
Hmm, ok :-)
--
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]