Repository navigation
MOD: match Excel large quotient limit - #98
Harrison-Booth wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
MOD threshold behavior crates/functions/src/math.rs, crates/functions/src/math/tests.rs, docs/function-parity.md |
modulo returns #NUM! when the absolute quotient is at least 1.1259e12. Tests cover quotients at and above the limit, as well as results below it. The parity document records the Excel 16.0 behavior and its revision date. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: aiongg, echelon
Merge Risk: 
Minimal · up to 5c31d
-
The focused MOD parity change is ready to merge, subject to normal CI checks.
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 limit: when|x / d| >= 1.1259e12, it returnsCellError::Num. - observed — Modified behavior in crates/functions/src/math/tests.rs: The
mod_tiny_divisor_stays_in_rangetest, which asserted valid remainder properties for four tiny-divisor cases, was replaced bymod_quotient_limit. The replacement expects#NUM!for eight cases where the absolute quotient is at least1.1259E12, and checks two MOD results below that limit. - observed — Modified behavior in docs/function-parity.md: The last-reviewed and last-updated dates change from 2026-10-15 and 2026-10-25 to 2026-10-30.
- observed — Modified behavior in docs/function-parity.md: A Formula language row documents that Excel 16.0
MODreturns#NUM!when the absolute quotient is at least1.1259E12; lower quotients return 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
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- 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.
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.Summary by CodeRabbit
Bug Fixes
MODfunction now returns#NUM!when the absolute quotient of the number divided by the divisor is at least1.1259E12. Division by zero continues to return an error.Documentation
MODquotient limit.