bitwise.srshift() function

bitwise.srshift() is experimental and subject to change at any time.

bitwise.srshift() shifts the bits in a right by b bits. Both a and b are integers.


Experimental bitwise.srshift is deprecated in favor of bitwise.srshift.

Function type signature
(a: int, b: int) => int

For more information, see Function type signatures.



(Required) Left hand operand.


(Required) Number of bits to shift.


Shift bits right in an integer

import "experimental/bitwise"

bitwise.srshift(a: 1234, b: 2)// Returns 308

Shift bits right in integers in a stream of tables

import "experimental/bitwise"
import "sampledata"
    |> map(fn: (r) => ({r with _value: bitwise.srshift(a: r._value, b: 3)}))

View example input and output

Was this page helpful?

Thank you for your feedback!

The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more