Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TheAlgorithms/Python
/ decimal_to_fraction.py
File
decimal_to_fraction.py
maths/decimal_to_fraction.py:None–None ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
def
decimal_to_fraction(decimal: float | str) -> tuple[int, int]:
2
""
"
3
Return a decimal number in its simplest fraction form
4
>>> decimal_to_fraction(2)
Callers
nothing calls this directly
Calls
1
decimal_to_fraction
Function · 0.85
Tested by
no test coverage detected