Design Architecture for Utility Functions (iss-1ac610bafd4c)
Some checks are pending
ci / test (push) Waiting to run
Some checks are pending
ci / test (push) Waiting to run
This commit is contained in:
parent
32f03c105e
commit
0f4e91734a
1 changed files with 20 additions and 0 deletions
20
utils/math_utils.py
Normal file
20
utils/math_utils.py
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
def add(a, b):
|
||||||
|
"""Returns the sum of two numbers."""
|
||||||
|
return a + b
|
||||||
|
|
||||||
|
|
||||||
|
def subtract(a, b):
|
||||||
|
"""Returns the difference of two numbers."""
|
||||||
|
return a - b
|
||||||
|
|
||||||
|
|
||||||
|
def multiply(a, b):
|
||||||
|
"""Returns the product of two numbers."""
|
||||||
|
return a * b
|
||||||
|
|
||||||
|
|
||||||
|
def divide(a, b):
|
||||||
|
"""Returns the quotient of two numbers. Raises ValueError on division by zero."""
|
||||||
|
if b == 0:
|
||||||
|
raise ValueError('Cannot divide by zero')
|
||||||
|
return a / b
|
||||||
Loading…
Add table
Add a link
Reference in a new issue