Skip to content

fix: Rounding behaviour for f32 values with "HalfAwayFromZero" mode#26624

Open
alexander-beedie wants to merge 1 commit intopola-rs:mainfrom
alexander-beedie:fix-f32-round-mode
Open

fix: Rounding behaviour for f32 values with "HalfAwayFromZero" mode#26624
alexander-beedie wants to merge 1 commit intopola-rs:mainfrom
alexander-beedie:fix-f32-round-mode

Conversation

@alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Feb 19, 2026

The f32 path with "RoundMode::HalfAwayFromZero" was using round_ties_even instead of round. Fixed, and added explicit test coverage for f16/f32/f64 values that triggers the tiebreaks that found the bug 👍

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Feb 19, 2026
@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.39%. Comparing base (375fdc8) to head (f5482a2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26624      +/-   ##
==========================================
+ Coverage   81.38%   81.39%   +0.01%     
==========================================
  Files        1794     1794              
  Lines      245003   245002       -1     
  Branches     3080     3080              
==========================================
+ Hits       199393   199428      +35     
+ Misses      44824    44788      -36     
  Partials      786      786              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix python Related to Python Polars rust Related to Rust Polars

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments