
19 Sep
2010
19 Sep
'10
2:30 p.m.
There's a timeout of 1.5 second right now.. On Sun, Sep 19, 2010 at 07:46:54PM +0200, Roel van Dijk wrote:
In my haste to reply I made an error in my 'newby' multiplication function. Pesky negative numbers...
intMul ∷ Integer → Integer → Integer intMul x n | n < 0 = -(intMul x $ abs n) | n == 0 = 0 | n > 0 = x + intMul x (n - 1)
I do wonder what happens when haltavista encounters a function that diverges. Like my original intMul applied to a negative number: "intMul 2 (-1)".