purplefox opened a new issue, #35310:
URL: https://github.com/apache/arrow/issues/35310
### Describe the bug, including details regarding any error messages,
version, and platform.
Hi All,
I came across this behaviour when creating a decimal128 from a string:
```
func TestDecFromStringStrangeness(t *testing.T) {
num, err := decimal128.FromString("2112.33", 38, 2)
require.NoError(t, err)
require.Equal(t, decimal128.New(0, 211233), num)
}
```
The value created seems to be out by one on the smallest digit:
```
=== RUN TestDecFromStringBugMaybe
decimal_test.go:54:
Error Trace:
/Users/tfox/Development/tektite/types/decimal_test.go:54
Error: Not equal:
expected: decimal128.Num{lo:0x33921, hi:0}
actual : decimal128.Num{lo:0x33920, hi:0}
Diff:
--- Expected
+++ Actual
@@ -1,3 +1,3 @@
(decimal128.Num) {
- lo: (uint64) 211233,
+ lo: (uint64) 211232,
hi: (int64) 0
Test: TestDecFromStringBugMaybe
--- FAIL: TestDecFromStringBugMaybe (0.00s)
```
### Component(s)
Go
--
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]