Last active
January 17, 2017 23:58
-
-
Save Qata/ebcb9599036c1eaee236f872f22a650f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(*!) :: (Ord a, Num a) => a -> a -> a | |
(*!) a b = | |
let | |
multiply _ 0 t = t | |
multiply a b t = multiply a (b - 1) (t + a) | |
in | |
if b >= 0 | |
then multiply a b 0 | |
else negate $ multiply a (negate b) 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment