Skip to content

Latest commit

 

History

History
69 lines (52 loc) · 1.65 KB

bits_not.md

File metadata and controls

69 lines (52 loc) · 1.65 KB
title categories version bits usage
bits not
bits
0.86.0
Performs logical negation on each bit.
Performs logical negation on each bit.

{{ $frontmatter.title }} for bits

{{ $frontmatter.bits }}

Signature

> bits not {flags}

Flags

  • --signed, -s: always treat input number as a signed number
  • --number-bytes, -n {string}: the size of unsigned number in bytes, it can be 1, 2, 4, 8, auto

Input/output types:

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

Examples

Apply logical negation to a list of numbers

> [4 3 2] | bits not
╭───┬─────────────────╮
│ 0140737488355323 │
│ 1140737488355324 │
│ 2140737488355325 │
╰───┴─────────────────╯

Apply logical negation to a list of numbers, treat input as 2 bytes number

> [4 3 2] | bits not --number-bytes '2'
╭───┬───────╮
│ 065531 │
│ 165532 │
│ 265533 │
╰───┴───────╯

Apply logical negation to a list of numbers, treat input as signed number

> [4 3 2] | bits not --signed
╭───┬────╮
│ 0-5 │
│ 1-4 │
│ 2-3 │
╰───┴────╯

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