feat: Add multiply and divide to the calculator #3
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "typosaurus/2-add-multiply-and-divide-to-the-calculator"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What was built
The calculator only supports addition and subtraction.
multiply(left, right)function to src/calculator.pydivide(left, right)function that raises ValueError when the divisor is zeroAcceptance criteria
multiply(left, right)function to src/calculator.pydivide(left, right)function that raises ValueError when the divisor is zeroCommits
8f7f09f44ad500f8d57fc2963f2a5c8a0709430bbdd86efbRun
Cost: 0.0015 USD · Nodes: 5 · Verification: make verify
Closes #2
Outcome: done Changed: src/calculator.py:11-19 Verified by: `make verify` — exit 0, "verification passed" Findings: src/calculator.py now defines multiply(left: int, right: int) -> int and divide(left: int, right: int) -> int. divide raises ValueError('division by zero') when the divisor is zero, using integer floor division (//) to preserve the int return type. Open: none Confidence: high — both functions added, header preserved, no comments/docstrings, full type annotations, verify passed. Typosaurus-Run: d9404e45783a42b586e07fc0342eee5c Typosaurus-Node: 430bbdd86efb4f16a1c90433f0667e6b Typosaurus-Agent: @nadia Refs: #2Outcome: done Changed: tests/test_calculator.py:1-65, Makefile:1 Verified by: `make verify` — exit 0, "Ran 16 tests in 0.000s ... OK" Findings: tests/test_calculator.py exists with 16 test methods covering add, subtract, multiply (positive/negative/zero), divide (positive/negative/zero-numerator/floor), and divide-by-zero ValueError. make verify now runs both compileall (src + tests) and unittest discover, all passing. Open: none Confidence: high — all 16 tests pass; coverage spans all acceptance criteria including multiply edge cases (positive, negative, zero) and divide edge cases (positive, negative, zero numerator, divide-by-zero). Typosaurus-Run: d9404e45783a42b586e07fc0342eee5c Typosaurus-Node: 00f8d57fc2964dc9bf5ae68ad25a6e18 Typosaurus-Agent: @sveta Refs: #2Pull request closed