RanaPriyansh opened a new pull request, #11344:
URL: https://github.com/apache/arrow-rs/pull/11344

   # Which issue does this PR close?
   
   - Closes #11316.
   
   # Rationale for this change
   
   `i256::to_f32` converts through `f64` and can round an integer twice. For 
example, `2^53 + 2^29 + 1` produces `0x5a000000` instead of `0x5a000001`.
   
   # What changes are included in this PR?
   
   Convert the unsigned magnitude directly to `f32` when it fits in `u128`, 
then apply its sign. Larger magnitudes produce signed infinity.
   
   # Are these changes tested?
   
   Tests cover both reported signs, midpoint neighbors, even and odd ties, 
significand carry, overflow, and integer extrema. Additional cases compare 
full-range conversions with decimal parsing.
   
   Validation: five conversion regressions, 370 all-feature tests, 63 doctests, 
361 release tests, and 12 downstream Decimal256 controls pass.
   Clippy, all three unused-dependency checks, formatting, spelling, and diff 
checks pass.
   
   Local checks used Rust 1.98.1. Checks on the new upstream Rust 1.99.0 pin 
remain unrun.
   
   # Are there any significant user-facing changes?
   
   Integer-to-`f32` conversions now avoid double rounding.
   
   Codex used.
   
   Generated material: regression tests, and PR description.
   
   The conversion method was also generated.
   


-- 
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]

Reply via email to