Elixir v1.0.5 Bitwise
This module provides macros and operators for bitwise operators. These macros can be used in guards.
The easiest way to use is to simply import them into your module:
iex> use Bitwise
iex> bnot 1
-2
iex> 1 &&& 1
1
You can select to include only or skip operators by passing options:
iex> use Bitwise, only_operators: true
iex> 1 &&& 1
1
Summary
Macros
Bitwise and as operator
Arithmetic bitshift left as operator
Arithmetic bitshift right as operator
Bitwise xor as operator
Allow a developer to use this module in their programs with the following options
Bitwise and
Bitwise not
Bitwise or
Arithmetic bitshift left
Arithmetic bitshift right
Bitwise xor
Bitwise or as operator
Bitwise not as operator
Macros
Allow a developer to use this module in their programs with the following options:
:only_operators
- include only operators:skip_operators
- skip operators