
29 Mar
2009
29 Mar
'09
12:23 a.m.
2009/3/28 michael rice
Still the same problem. The book says the answer is supposed to be an exact 98/67.
Michael
import Data.Ratio cf :: [Integer] -> Rational cf (x:xs) = (x % 1) + (1 % (cf xs)) cf (x:[]) = x % 1 cf [] = 0 % 1
Use (/) for division: cf :: [Integer] -> Rational cf (x:xs) = toRational x + 1 / cf xs cf [x] = toRational x cf [] = 0 Luke