pitrou commented on pull request #9948:
URL: https://github.com/apache/arrow/pull/9948#issuecomment-817835991
So here is how inference should work IMHO:
* compute both the magnitude of most-significant digit and least-significant
digit
* examples:
* `Decimal(12345) => msd = 4, lsd = 0`
* `Decimal(12345e2) => msd = 6, lsd = 2`
* `Decimal(1234.5) => msd = 3, lsd = -1`,
* `Decimal(0.012345) => msd = -2, lsd = -6`
* `Decimal(0) => msd = -inf, lsd = +inf`
* track `max(msd)` and `min(lsd)`
* at the end, `precision = max_msd - min_lsd + 1`, `scale = -min_lsd`
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]