Bitwise Operations

Functions for bitwise operations

Qualified Name Type

apoc.bitwise.op(a INTEGER, operator STRING, b INTEGER) - returns the result of the bitwise operation.

Function

Examples

operator name example result

a & b

AND

apoc.bitwise.op(60,"&",13)

12

a | b

OR

apoc.bitwise.op(60,"|",13)

61

a ^ b

XOR

apoc.bitwise.op(60,"&",13)

49

~a

NOT

apoc.bitwise.op(60,"&",0)

-61

a << b

LEFT SHIFT

apoc.bitwise.op(60,"<<",2)

240

a >> b

RIGHT SHIFT

apoc.bitwise.op(60,">>",2)

15

a >>> b

UNSIGNED RIGHT SHIFT

apoc.bitwise.op(60,">>>",2)

15