Repository navigation
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe modular exponential function now initializes its result as ChangesModular exponential behavior
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The change aligns the zero-exponent result with Python’s modular 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
modular_exponential(7, 0, 1)returns1, while Python'spow(7, 0, 1)returns0. The zero-exponent identity also needs reduction for negative moduli, which the existing loop otherwise supports.Initialize the result as
1 % modand document the nonzero modulus domain. Add a built-inpoworacle across signed bases, zero/positive exponents, and positive/negative moduli, plus a zero-modulus regression.Validation: 721 tests pass; 480 documentation examples pass (one existing skip); repository Ruff checks pass.
Prepared with AI assistance and verified locally against the stated oracles.
Summary by CodeRabbit
Bug Fixes
powbehavior for positive and negative nonzero moduli, including when the exponent is zero.ZeroDivisionError.Tests
powacross selected bases, exponents, and moduli.