Skip to content


Converts an integer to its bit array representation.


  • integer (int)

    The input integer. May be any nonnegative integer.

  • width (Optional[int])

    If this parameter is specified, the output will be filled with zeros on the right so that its length will be the specified value.


  • binlist (Array1D[int])

    An array of $0$'s and $1$'s whose $i$-th element stands for the coefficient of $2^i$ in the binary representation of the input integer.


>>> komm.int2binlist(26)
array([0, 1, 0, 1, 1])
>>> komm.int2binlist(26, width=8)
array([0, 1, 0, 1, 1, 0, 0, 0])