Fix off-by-one in e

This commit is contained in:
rnhmjoj 2016-02-23 04:19:45 +01:00
parent d23b21de6b
commit dea3df894c

View File

@ -61,7 +61,7 @@ toList (x:|xs) = x : toList xs
-- --
-- <<https://i.imgur.com/q1SwKoy.png>> -- <<https://i.imgur.com/q1SwKoy.png>>
e :: Number e :: Number
e = fmap a σ where e = 1 + fmap a σ where
a n | p == 0 = 2*q a n | p == 0 = 2*q
| otherwise = 1 | otherwise = 1
where (q, p) = quotRem n 3 where (q, p) = quotRem n 3