Created
September 16, 2015 18:50
-
-
Save letroot/1ac5d382bb3c9e04ff4c to your computer and use it in GitHub Desktop.
This file contains 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
def multiply(x, y): | |
if y == 0: | |
return 0 | |
z = multiply(x, y/2) | |
if y%2 == 0: | |
return 2*z | |
else: | |
return x + 2*z |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment