Abacus.Runtime.Helpers (abacus v2.1.0)
Utility functions
Summary
Functions
Returns the factorial of n.
Types
Link to this type
operator()
@type operator() :: :== | :!= | :> | :< | :<= | :>=
Link to this type
typeof()
@type typeof() :: :atom | :binary | :float | :integer | :list | :map
Functions
Link to this function
cast_for_comparison(atom)
Link to this function
compare(op, lhs, rhs)
Link to this function
compare(op, lhs, rhs, type, type)
Link to this function
factorial(n)
Returns the factorial of n.
Example
iex(2)> factorial(0)
1
iex(3)> factorial(1)
1
iex(4)> factorial(2)
2
iex(5)> factorial(3)
6
iex(6)> factorial(4)
24
iex(7)> factorial(5)
120
Link to this function
typeof(a)
Link to this function