W3cubDocs

/Nushell

bits and for bits

Performs bitwise and for integers.

Signature

> bits and {flags} (target)

Parameters

  • target: target integer to perform bit and

Input/output types:

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

Examples

Apply bits and to two numbers

>2|bits and2
2

Apply logical and to a list of numbers

> [432] |bits and2
╭───┬───╮
00
12
22
╰───┴───╯

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

Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/bits_and.html