Struct that implements the logic of the reduced fraction, and NUnit tests for its verification. Conversion operations to/from int, double are implemented. Arithmetic operations on reduced fractions are implemented.
Operations implemented:
- ReduceFraction * ReduceFraction
- ReduceFraction / ReduceFraction
- ReduceFraction + ReduceFraction
- ReduceFraction - ReduceFraction
- ReduceFraction * int
- ReduceFraction / int
- ReduceFraction + int
- ReduceFraction - int
Convertations implemented:
- ReduceFraction to double (implicit)
- ReduceFraction to int (explicit)
- int to ReduceFraction (implicit)
Learn more: https://mathworld.wolfram.com/ReducedFraction.html