bits and for bits

Performs bitwise and for ints.

Signature

> bits and {flags} (target)

Parameters

  • target: target int to perform bit and

Input/output types:

input output
int int
list<int> list<int>

Examples

Apply bits and to two numbers

> 2 | bits and 2
2

Apply logical and to a list of numbers

> [4 3 2] | bits and 2
╭───┬───╮
│ 0 │ 0 │
│ 1 │ 2 │
│ 2 │ 2 │
╰───┴───╯

Tips: Command bits and was not included in the official binaries by default, you have to build it with --features=extra flag