aboutsummaryrefslogtreecommitdiffstats
path: root/calc.erl
diff options
context:
space:
mode:
Diffstat (limited to 'calc.erl')
-rw-r--r--calc.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/calc.erl b/calc.erl
index b7981a1..04ac38f 100644
--- a/calc.erl
+++ b/calc.erl
@@ -9,6 +9,8 @@ num([Current|Input], Num) when ($0 =< Current) and ($9 >= Current) ->
num(Input, Num ++ [Current]);
num([Head|_], "-") ->
{error, {unexpected, list_to_atom([Head])}};
+num(Input, []) ->
+ {ok, {Input, []}};
num(Input, Num) ->
{ok, {Input, list_to_integer(Num)}}.