Created
May 17, 2019 12:43
-
-
Save iamvery/8ceb0c968599f22b7f973cb54a9924ab 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
defmodule Power do | |
use Bitwise | |
def find(i) when i > 0 do | |
find(i, 1) | |
end | |
def find(i, p) when p < i do | |
find(i, p <<< 2) | |
end | |
def find(_, p) do | |
p | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment