Xor 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 exclusive-OR (XOR) of two integers. This performs the same computation as the built-in ^^^ operator.

function Xor (a : Int, b : Int) : Int

Input

a : Int

b : Int

Output : Int

Example

let a = 248;       //                 11111000₂
let b = 63;        //                 00111111₂
let x = Xor(a, b); // x : Int = 199 = 11000111₂.

Remarks

See the C# ^ Operator for more details.