On this page
article
Exact Fractions
Represent rationals exactly.
Category: fractions
Problem
Represent rationals exactly.
Solution
f = Fraction(1, 3) + Fraction(1, 6)
Notes
- Adapt variable names and paths to your project
- Add error handling for production use
- See related chapters in the Learning Path