Skip to content

Commit e3fb530

Browse files
Improve decimal_to_fraction.py (TheAlgorithms#12611)
* Update decimal_to_fraction.py * Update decimal_to_fraction.py --------- Co-authored-by: Maxim Smolskiy <[email protected]>
1 parent 4fbd350 commit e3fb530

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: maths/decimal_to_fraction.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def decimal_to_fraction(decimal: float | str) -> tuple[int, int]:
4848
if remainder == 0:
4949
break
5050
dividend, divisor = divisor, remainder
51-
numerator, denominator = numerator / divisor, denominator / divisor
52-
return int(numerator), int(denominator)
51+
numerator, denominator = numerator // divisor, denominator // divisor
52+
return numerator, denominator
5353

5454

5555
if __name__ == "__main__":

0 commit comments

Comments
 (0)