Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.21 KB

bits_ror.md

File metadata and controls

57 lines (41 loc) · 1.21 KB
title categories version bits usage
bits ror
bits
0.86.0
Bitwise rotate right for ints.
Bitwise rotate right for ints.

{{ $frontmatter.title }} for bits

{{ $frontmatter.bits }}

Signature

> bits ror {flags} (bits)

Flags

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

Parameters

  • bits: number of bits to rotate right

Input/output types:

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

Examples

Rotate right a number with 60 bits

> 17 | bits ror 60
272

Rotate right a list of numbers of one byte

> [15 33 92] | bits ror 2 --number-bytes '1'
╭───┬─────╮
│ 0195 │
│ 172 │
│ 223 │
╰───┴─────╯

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