Fix remainder panic for f62#114
Conversation
Merging this PR will degrade performance by 2.7%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | f62_checked_rem_integer |
195.5 µs | 201 µs | -2.7% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing chore/rem-panic (1bcd588) with main (ee2b2f7)
Footnotes
-
10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
There was a problem hiding this comment.
Pull request overview
This PR updates Float62’s % (remainder) implementation to avoid panicking when the divisor is zero, aligning behavior with typical floating-point remainder semantics by producing NaN instead.
Changes:
- Replace the
operate!(..., rem)macro path with explicit integer/float branching to prevent integer remainder-by-zero panics. - Return
NaNfor integer remainder when the divisor is0. - Update the
rem_by_zerotest to assertNaNresults instead of expecting a panic, and broaden the assertions (positive/negative and float lhs).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.