Skip to content

Add basic mathematical calculations utility module - #5

Open
rwtamCaltech wants to merge 1 commit into
masterfrom
claude/add-math-calculations-s0rT7
Open

Add basic mathematical calculations utility module#5
rwtamCaltech wants to merge 1 commit into
masterfrom
claude/add-math-calculations-s0rT7

Conversation

@rwtamCaltech

Copy link
Copy Markdown
Owner

Summary

  • Adds math_utils.py with 8 utility functions: add, subtract, multiply, divide, power, square_root, mean, median
  • divide raises ValueError on zero divisor
  • square_root raises ValueError for negative inputs
  • All functions include docstrings

Closes #4

Test plan

  • Import math_utils from another script and verify each function returns the expected result
  • Confirm divide(1, 0) raises ValueError
  • Confirm square_root(-1) raises ValueError
  • Confirm mean([]) and median([]) raise ValueError

Implements math_utils.py with add, subtract, multiply, divide, power,
square_root, mean, and median functions. Division and square_root include
guards for invalid inputs (zero division, negative radicand).

Closes #4

https://claude.ai/code/session_01LXZCDpBQp4Mj2Z8dDvs5y3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add basic mathematical calculations utility module

2 participants