close
Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 637 Bytes

File metadata and controls

34 lines (27 loc) · 637 Bytes
layout api-command
language JavaScript
permalink api/javascript/bit_not/
command bitNot
io
number
number
related_commands
bit_and bit_or bit_sal bit_sar bit_xor
bit_and/
bit_or/
bit_sal/
bit_sar/
bit_xor/

Command syntax

{% apibody %} r.bitNot() → number {% endapibody %}

Description

A bitwise NOT, or complement, is a unary operation that performs logical negation on each bit, forming the ones' complement of the given binary value. Bits that are 0 become 1, and those that are 1 become 0.

Example:

r.expr(7).bitNot().run(conn);

// Result:
-8