""" 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