Anonymous user
Fraction reduction: Difference between revisions
m
→{{header|Haskell}}
Line 1,382:
findReductions :: Fraction -> [Reduction]
findReductions z@(n1, d1) = foldr f []
where
decimal = realToFrac n1 / realToFrac d1
f x r | decimalWithDrop == decimal = (z, (n2, d2), x) : r
|