Not function

Warning

This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.

Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.

Namespace: Microsoft.Quantum.Bitwise

Package: Microsoft.Quantum.QSharp.Foundation

Returns the bitwise NOT of an integer. This performs the same computation as the built-in ~~~ operator.

function Not (a : Int) : Int

Input

a : Int

Output : Int

Example

let a = 248;
let x = Not(a); // x : Int = -249, due to two's complement representation.

Remarks

See the C# ~ Operator for more details.