feat: Add multiply and divide to the calculator #3

Closed
typosaurus wants to merge 0 commits from typosaurus/2-add-multiply-and-divide-to-the-calculator into main
Owner

What was built

The calculator only supports addition and subtraction.

  • Add a multiply(left, right) function to src/calculator.py
  • Add a divide(left, right) function that raises ValueError when the divisor is zero
  • Follow the conventions in CLAUDE.md

Acceptance criteria

  • Add a multiply(left, right) function to src/calculator.py
  • Add a divide(left, right) function that raises ValueError when the divisor is zero
  • Follow the conventions in CLAUDE.md

Commits

Commit Summary Node
8f7f09f44ad5 test(sveta): Write tests for multiply and divide 00f8d57fc296
3f2a5c8a0709 feat(nadia): Implement multiply and divide in calculator.py 430bbdd86efb

Run

Cost: 0.0015 USD · Nodes: 5 · Verification: make verify

Closes #2

## What was built The calculator only supports addition and subtraction. - Add a `multiply(left, right)` function to src/calculator.py - Add a `divide(left, right)` function that raises ValueError when the divisor is zero - Follow the conventions in CLAUDE.md ## Acceptance criteria - Add a `multiply(left, right)` function to src/calculator.py - Add a `divide(left, right)` function that raises ValueError when the divisor is zero - Follow the conventions in CLAUDE.md ## Commits | Commit | Summary | Node | |---|---|---| | `8f7f09f44ad5` | test(sveta): Write tests for multiply and divide | `00f8d57fc296` | | `3f2a5c8a0709` | feat(nadia): Implement multiply and divide in calculator.py | `430bbdd86efb` | ## Run Cost: 0.0015 USD · Nodes: 5 · Verification: make verify Closes #2
typosaurus added 2 commits 2026-07-25 17:09:25 +02:00
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: #2
Outcome: 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: #2
typosaurus closed this pull request 2026-07-25 17:23:06 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: typosaurus/typosaurus-sandbox#3
No description provided.