Skip to content

Latest commit

 

History

History
58 lines (40 loc) · 1.61 KB

intbitnot.md

File metadata and controls

58 lines (40 loc) · 1.61 KB
title titleSuffix description author ms.author ms.reviewer ms.service ms.subservice ms.topic ms.devlang ms.date ms.custom
IntBitNot
Azure Cosmos DB for NoSQL
An Azure Cosmos DB for NoSQL system function that returns the complement of a number.
jcodella
jacodel
sidandrews
cosmos-db
nosql
reference
nosql
02/27/2024
query-reference

IntBitNot (NoSQL query)

[!INCLUDENoSQL]

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.

:::code language="nosql" source="~/cosmos-db-nosql-query-samples/scripts/intbitnot/query.novalidate.sql" highlight="2-4":::

:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/intbitnot/result.novalidate.json":::

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