Repository navigation
MOD: match Excel large quotient limit - #2979
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Quotient check and validation crates/functions/src/math.rs, crates/functions/src/math/tests.rs, docs/function-parity.md |
modulo returns #NUM! when abs(x / d) >= 1.1259e12, after checking for a zero divisor. Tests cover errors at and above the limit and successful remainders below it. The parity document records the Excel 16.0 behavior. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: aiongg, echelon
Merge Risk: 
Minimal · up to 5c31d
-
No actionable merge-blocking risk remains in the reviewed change.
Architecture risk: 
Low · up to 5c31d
-
The change affects 2 systems.
Changed systems:
crates,docsArchitecture concerns
No architecture-level concerns identified.Review details
-
Systems and components
- observed — crates (service) was modified; 2 changed files map to changed impact.
- observed — docs (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
- observed — Modified behavior in crates/functions/src/math.rs:
moduloadds a quotient-magnitude check: whenabs(x / d) >= 1.1259e12, it returnsCellError::Num; the zero-divisor check still occurs first. - observed — Modified behavior in crates/functions/src/math/tests.rs: Replaces
mod_tiny_divisor_stays_in_range, which checked that tiny-divisor results were zero or had the divisor’s sign and a smaller magnitude, withmod_quotient_limit. The new test expects#NUM!for eight cases whose absolute quotient is at least1.1259E12, and checks successful remainders just below the limit and for a large multiple with remainder 3. - observed — Modified behavior in docs/function-parity.md: The review and update dates change from October 15 and October 25 to October 30, 2026, and the change description adds a MOD edge-case parity row.
- observed — Modified behavior in docs/function-parity.md: Adds the MOD quotient limit: Excel 16.0 returns
#NUM!whenABS(number/divisor) >= 1.1259E12; lower quotients retain the remainder.
-
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
⚔️ Resolve merge conflicts: 💡
-
- Resolve merge conflict in branch
gc-fix-2657
- Resolve merge conflict in branch
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Landed in main (67e39fa). Thank you for the contribution, @Harrison-Booth, and for splitting and following up on the review! |
Makes MOD return
#NUM!whenABS(number/divisor) >= 1.1259E12, matching Excel 16.0, and adds the function'sdocs/function-parity.mdrow. The boundary and large quotient values are covered by regression cases.Verification: Expected results come from the Excel 16.0 COM observations documented in the original combined PR.
cargo fmt --checkpassed locally. Per task instructions, Rust tests were not run locally; fork CI runs them.🤖 Generated with Claude Code
Summary by CodeRabbit
MODfunction now returns#NUM!when the absolute number-to-divisor quotient is at least1.1259E12. Quotients below this limit continue to return the remainder, and a zero divisor continues to return#DIV/0!.MODquotient limit.