2015-06-21 階乗 Elixir #!/usr/bin/env elixir defmodule Foo do def fact(n) do fact(n, 1) end defp fact(0, acc) do acc end defp fact(n, acc) do fact(n - 1, acc * n) end end IO.puts Foo.fact(65535) real 0m13.120s user 0m12.577s sys 0m0.201s