Friday, February 27, 2009

Using recursive addition to multiply in haskell

multiply :: Int -> Int -> Int
multiply m n
| n >= 1        = m + multiply (n-1) m
| otherwise     = 0

No comments:

Post a Comment