Skip to content

fix(compute): round negative HalfToOdd ties correctly - #1094

Merged
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/decimal-half-to-odd-negative
Aug 6, 2026
Merged

fix(compute): round negative HalfToOdd ties correctly#1094
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/decimal-half-to-odd-negative

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

The decimal HalfToOdd kernel uses the remainder sign incorrectly when adjusting negative ties. Some negative values therefore round to an even result instead of the nearest odd result.

What changes are included in this PR?

Use the signed remainder when choosing the adjustment for Decimal128 and Decimal256. Leave round_to_multiple unchanged.

Are these changes tested?

  • go test ./arrow/compute/...

Are there any user-facing changes?

No API changes. This corrects the reported behavior while preserving the existing ownership and compatibility contracts.

@fallintoplace fallintoplace changed the title fix(compute): round negative decimal ties to odd values fix(compute): round negative decimal ties using HalfToOdd Aug 5, 2026
@fallintoplace fallintoplace changed the title fix(compute): round negative decimal ties using HalfToOdd fix(compute): round negative HalfToOdd ties correctly Aug 6, 2026
@zeroshade
zeroshade merged commit bc6d2df into apache:main Aug 6, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants