bitwise_binary v0.1.0 Bitwise.Binary
Simple module to extend bitwise operations to full binaries (and not just integers).
Link to this section Summary
Functions
Calculates the bitwise AND of its arguments.
Calculates the result of an arithmetic left shift.
Calculates the result of an arithmetic right shift.
Calculates the bitwise XOR of its arguments.
Calculates the bitwise AND of its arguments.
Calculates the bitwise NOT of its arguments.
Calculates the bitwise OR of its arguments.
Calculates the result of an arithmetic left shift.
Calculates the result of an arithmetic right shift.
Calculates the bitwise XOR of its arguments.
Calculates the bitwise OR of its arguments.
Calculates the bitwise NOT of its arguments.
Link to this section Functions
left &&& right
Calculates the bitwise AND of its arguments.
iex> <<9, 0>> &&& <<3, 0>>
<<1, 0>>
left <<< right
Calculates the result of an arithmetic left shift.
iex> <<1, 0>> <<< 2
<<4, 0>>
left >>> right
Calculates the result of an arithmetic right shift.
iex> <<4, 0>> >>> 2
<<1, 0>>
left ^^^ right
Calculates the bitwise XOR of its arguments.
iex> <<9, 0>> ^^^ <<3, 0>>
<<10, 0>>
band(left, right)
Calculates the bitwise AND of its arguments.
iex> band(<<9, 0>>, <<3, 0>>)
<<1, 0>>
bnot(expr)
Calculates the bitwise NOT of its arguments.
iex> bnot(<<2, 0>>)
<<253, 255>>
bor(left, right)
Calculates the bitwise OR of its arguments.
iex> bor(<<9, 0>>, <<3, 0>>)
<<11, 0>>
bsl(left, right)
Calculates the result of an arithmetic left shift.
iex> <<1, 0>> <<< 2
<<4, 0>>
bsr(left, right)
Calculates the result of an arithmetic right shift.
iex> <<4, 0>> >>> 2
<<1, 0>>
bxor(left, right)
Calculates the bitwise XOR of its arguments.
iex> <<9, 0>> ^^^ <<3, 0>>
<<10, 0>>
left ||| right
Calculates the bitwise OR of its arguments.
iex> <<9, 0>> ||| <<3, 0>>
<<11, 0>>
~~~expr
Calculates the bitwise NOT of its arguments.
iex> ~~~<<2, 0>>
<<253, 255>>