Skip to content

Fix remainder panic for f62#114

Merged
raviqqe merged 1 commit into
mainfrom
chore/rem-panic
Jul 6, 2026
Merged

Fix remainder panic for f62#114
raviqqe merged 1 commit into
mainfrom
chore/rem-panic

Conversation

@raviqqe

@raviqqe raviqqe commented Jul 6, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 6, 2026 05:40
@raviqqe
raviqqe enabled auto-merge (squash) July 6, 2026 05:40
@codspeed-hq

codspeed-hq Bot commented Jul 6, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 2.7%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 40 untouched benchmarks
⏩ 10 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

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)

Open in CodSpeed

Footnotes

  1. 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 NaN for integer remainder when the divisor is 0.
  • Update the rem_by_zero test to assert NaN results 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.

@raviqqe
raviqqe merged commit 0243141 into main Jul 6, 2026
13 of 14 checks passed
@raviqqe
raviqqe deleted the chore/rem-panic branch July 6, 2026 05:48
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