Abacus.Runtime.Helpers (abacus v2.0.0)

Utility functions

Link to this section Summary

Link to this section Types

Specs

operator() :: :== | :!= | :> | :< | :<= | :>=

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

compare(operator(), any(), any()) :: boolean()
Link to this function

compare(op, lhs, rhs, type, type)

Specs

compare(operator(), any(), any(), atom(), atom()) :: boolean()

Specs

factorial(number()) :: number()

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

Specs

typeof(any()) :: typeof()
Link to this function

unescape_string(list)