Integer.digits
You're seeing just the function
digits
, go back to Integer module for more information.
Specs
digits(integer(), pos_integer()) :: [integer(), ...]
Returns the ordered digits for the given integer
.
An optional base
value may be provided representing the radix for the returned
digits. This one must be an integer >= 2.
Examples
iex> Integer.digits(123)
[1, 2, 3]
iex> Integer.digits(170, 2)
[1, 0, 1, 0, 1, 0, 1, 0]
iex> Integer.digits(-170, 2)
[-1, 0, -1, 0, -1, 0, -1, 0]