Shell-aurum opened a new pull request, #1707:
URL: https://github.com/apache/arrow-go/pull/1707
Fixes #1695.
`FromString` rejected literals with a negative scale whenever the *unscaled*
literal was too large, even when dividing by 10^-scale produced a value that
fits. The negative-scale branch of `fromDecimalLiteral` checked
`AtLeastTwoPower(0, bits)` instead of applying the scale like the
positive-scale branch.
This change passes the scale to `AtLeastTwoPower`, so the post-scaling
magnitude is checked without allocating for huge exponents. Values such as
`Decimal32FromString("5000000000", 2, -9)` and `decimal128.FromString("2e38",
1, -38)` now parse correctly.
Tests that asserted the old behavior (`TestBitLen`,
`TestFromStringScaleOutOfRange`, and the decimal32/64 assertions in
`TestFromString`) are updated, with new regression cases added for all four
decimal widths.
--
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]