Skip to content

Commit

Permalink
Update calculator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ompatel277 authored Feb 7, 2025
1 parent 05832f5 commit b31841b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ def multiplication(x: int, y: int) -> int:

def division(x: int, y: int) -> float:
"""
Divides two numbers using integer division.
Divides two numbers.
Args:
x (int): The first parameter.
y (int): The second parameter.
Returns:
int: `x` divided by `y` (integer division).
float: The result of `x` divided by `y`.
Raises:
ValueError: If `y` is zero.
"""
if y == 0:
raise ValueError("Cannot divide by zero")
return x // y
return x / y # Floating-point division

0 comments on commit b31841b

Please sign in to comment.