Abacus.Runtime.Helpers (abacus v2.1.0)

Utility functions

Summary

Types

@type operator() :: :== | :!= | :> | :< | :<= | :>=
@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)

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

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

@spec compare(operator(), any(), any(), atom(), atom()) :: boolean()
@spec 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
@spec typeof(any()) :: typeof()
Link to this function

unescape_string(list)