aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/escript_SUITE_data/factorial_warning
blob: ef214e096a842c3d9794f16f7c8631f57aa23307 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env escript

main([In]) ->
    X = list_to_integer(In),
    N = fac(X),
    io:format("factorial ~w = ~w~n",[X, N]).

fac(0) -> 1;
fac(N) ->
    N * fac(N-1).

bar() ->
    ok.