Documentation
¶
Overview ¶
Package bitwise provides APOC bitwise operations.
This package implements all apoc.bitwise.* functions for bitwise operations on integers.
Index ¶
- func And(values ...int64) int64
- func ClearBit(value int64, position int) int64
- func CountBits(value int64) int
- func LeftShift(value int64, positions int64) int64
- func Not(value int64) int64
- func Op(a int64, operation string, b int64) int64
- func Or(values ...int64) int64
- func ReverseBits(value int64) int64
- func RightShift(value int64, positions int64) int64
- func RotateLeft(value int64, positions int) int64
- func RotateRight(value int64, positions int) int64
- func SetBit(value int64, position int) int64
- func TestBit(value int64, position int) bool
- func ToggleBit(value int64, position int) int64
- func Xor(values ...int64) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountBits ¶
CountBits counts the number of set bits (population count).
Example:
apoc.bitwise.countBits(15) => 4
func Op ¶
Op performs a bitwise operation on two integers.
Example:
apoc.bitwise.op(12, '&', 10) => 8
func ReverseBits ¶
ReverseBits reverses the bits in a value.
Example:
apoc.bitwise.reverseBits(1) => 9223372036854775808
func RotateRight ¶
RotateRight rotates bits to the right.
Example:
apoc.bitwise.rotateRight(4, 2) => 1
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.