elixir-in-action/test_num2.ex
2020-06-20 13:57:33 -05:00

11 lines
182 B
Elixir

defmodule TestNum do
def test(x) when is_number(x) and x < 0 do
:negative
end
def test(0), do: :zero
def test(x) when is_number(x) and x > 0 do
:positive
end
end