我是Haskell的新手。我有一个代码:
mwave :: Int -> Int
mwave = (map wave [0..] !!)
where wave 0 = 1
wave 1 = 1
wave n = ((3 * n - 3) * mwave (n - 2) + (2 * n + 1) * mwave (n - 1)) `div` (n + 2)
digits :: Int -> Int
digits n = (mwave n) `mod` 10^100::Integer
Output: wave.exe: divide by zero
我必须输出模数10 ^ 100的答案。我怎么能这样做?