Files
webber/sandbox-templates/calculator-cli/src/calculator/operations.py
T
jpmschweitzerandClaude Opus 4.5 3b58fa4f8b
Build and Push API / release (push) Successful in 3s
Build and Push API / build (push) Successful in 2m27s
refactor: reorganize into monorepo with separate subprojects
Structure webber into three independent subprojects:
- webber-api/: FastAPI backend server with all agent code
- webber-cli/: Standalone CLI client (renamed from cli/ to webber_cli/)
- webber-sandbox/: Test project for functional testing

Key changes:
- Each subproject has its own .venv (Python 3.12+)
- Added sandbox.sh for managing test project templates
- Created sandbox-templates/ with calculator-cli and empty starter
- Updated CI/CD for prefixed tags (api/v*, cli/v*)
- Added comprehensive AGENTS.md with operational instructions
- Added gitignore filtering to glob and grep tools
- Created pyproject.toml for each subproject

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 10:37:47 +01:00

44 lines
878 B
Python

"""
Math operations for the calculator.
NOTE: This file contains intentional bugs for testing purposes.
"""
def add(a: float, b: float) -> float:
"""Add two numbers."""
return a + b
def subtract(a: float, b: float) -> float:
"""Subtract b from a."""
return a - b
def multiply(a: float, b: float) -> float:
"""Multiply two numbers."""
return a * b
def divide(a: float, b: float) -> float:
"""
Divide a by b.
BUG: Does not handle division by zero!
"""
# BUG: No check for b == 0
return a / b
def power(a: float, b: float) -> float:
"""
Raise a to the power of b.
BUG: Negative exponents not handled correctly for some cases.
"""
# BUG: This naive implementation has issues with negative bases and fractional exponents
result = 1
for _ in range(int(b)):
result *= a
return result