Last active
June 22, 2016 14:10
-
-
Save narrowtux/6daf3c232d165cdf8d2dc95241c8fa60 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 Range | |
def range(num, min_value, max_value) do | |
num | |
|> min(max_value) | |
|> max(min_value) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An alternative version with guards... 😀