Abacus.Runtime.Helpers (abacus v2.0.0)
Utility functions
Link to this section Summary
Functions
Returns the factorial of n.
Link to this section Types
Link to this type
operator()
Specs
operator() :: :== | :!= | :> | :< | :<= | :>=
Link to this type
typeof()
Specs
typeof() :: :atom | :binary | :float | :integer | :list | :map
Link to this section Functions
Link to this function
cast_for_comparison(atom)
Link to this function
compare(op, lhs, rhs)
Specs
Link to this function
compare(op, lhs, rhs, type, type)
Specs
Link to this function
factorial(n)
Specs
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)
Specs
Link to this function