Rediger

Del via


IntBitNot (NoSQL query)

APPLIES TO: NoSQL

Returns the bitwise complement of the operand. For example, every 1 bit individually yields 0 for the corresponding bit in the result. For more information, see bitwise complement operator.

Syntax

IntBitNot(<int_expr>)

Arguments

Description
int_expr An integer expression, which is used as the sole operand.

Return types

Returns a 64-bit integer.

Note

For more information, see __int64.

Examples

This example tests the function with various static values.

SELECT VALUE {
    complementNumber: IntBitNot(65),
    complementZero: IntBitNot(0),
    complementDecimal: IntBitNot(0.1)
}
[
  {
    "complementNumber": -66,
    "complementZero": -1
  }
]

Remarks

  • This function expects integers for both arguments and performs operations assuming the values are a 64-bit integer.
  • If any of the arguments aren't an integer, the function returns undefined.
  • Overflow behavior is similar to the implementation in C++ (wrap-around).

See also