Skip to content

Instantly share code, notes, and snippets.

@iamvery
Created May 17, 2019 12:43
Show Gist options
  • Save iamvery/8ceb0c968599f22b7f973cb54a9924ab to your computer and use it in GitHub Desktop.
Save iamvery/8ceb0c968599f22b7f973cb54a9924ab to your computer and use it in GitHub Desktop.
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