|
This post has NOT been accepted by the mailing list yet.
I have:
power :: Int -> Int -> Int
power a b
| b <= 0 = 0
| b == 1 = a
| otherwise = a * power a (b-1)
which works for 'power 2 10' and other small-ish results but not for 'power 3 561' - it just returns the wrong result. could anyone tell me why this might be?
Thanks a lot
|