Skip to content

Instantly share code, notes, and snippets.

@mrunalp
Created June 21, 2009 23:39
Show Gist options
  • Save mrunalp/133716 to your computer and use it in GitHub Desktop.
Save mrunalp/133716 to your computer and use it in GitHub Desktop.
(define (fast-mult a b)
(cond ((= b 0) 0)
((even? b) (fast-mult (+ a a) (/ b 2)))
(else (+ a (fast-mult a (- b 1))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment