BitXor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (change example)
(Example added)
 
Line 17: Line 17:


==Example==
==Example==
{{Example}}
This example will do a bitwise XOR of x1, x2, ...
 
<syntaxhighlight lang="lua">
local x1 = 0x14 -- binary: 0001 0100
local x2 = 0x1C -- binary: 0001 1100
 
bitXor(x1, x2)  -- return  0000 1000
</syntaxhighlight>


==See Also==
==See Also==
{{Bit_functions}}
{{Bit_functions}}

Latest revision as of 21:54, 8 January 2016

This function performs a bitwise XOR-conjunction (exclusive OR) on two or more (unsigned) 32-bit integers. See Bitwise operation for more details.

Syntax

uint bitXor ( uint var1, uint var2, ... )

Required arguments

  • varN: The value you want to perform a XOR-conjunction on

Returns

Returns the conjuncted value.

Example

This example will do a bitwise XOR of x1, x2, ...

local x1 = 0x14 -- binary: 0001 0100
local x2 = 0x1C -- binary: 0001 1100

bitXor(x1, x2)  -- return  0000 1000

See Also