Skip to content

Fix TiesToAway rounding below the smallest-subnormal midpoint - #68

Merged
awf merged 2 commits into
mainfrom
copilot/fix-round-float-tying-issue
Oct 18, 2026
Merged

awf merged 2 commits into
mainfrom
copilot/fix-round-float-tying-issue

Conversation

Copilot AI commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

round_float could round inputs just below half the smallest subnormal away from zero because delta + 0.5 rounds to 1.0 in binary64. This disagrees with round_ndarray.

  • Rounding: Compare delta >= 0.5 directly, matching the array implementation.
  • Regression coverage: Check values immediately below, at, and above the midpoint for signed, extended P3109(8, 3), across both signs and APIs.

Co-authored-by: awf <128119+awf@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix round_float with TiesToAway rounding for small inputs Fix TiesToAway rounding below the smallest-subnormal midpoint Oct 18, 2026
Copilot AI requested a review from awf October 18, 2026 11:39

@awf awf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, agrees with proposed fix.

@awf
awf marked this pull request as ready for review October 18, 2026 13:19
@awf
awf merged commit 3b7c3bb into main Oct 18, 2026
3 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.

round_float with TiesToAway rounds inputs just below half the smallest subnormal up

2 participants