BitOr: Difference between revisions
Jump to navigation
Jump to search
(Fixed version) |
(Example added) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{Server client function}} | {{Server client function}} | ||
__NOTOC__ | __NOTOC__ | ||
{{New feature/item|3.0132|1.3.2|5340| | {{New feature/item|3.0132|1.3.2|5340| | ||
Line 18: | Line 17: | ||
==Example== | ==Example== | ||
This example will do a bitwise OR of x1, x2, ... | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local x1 = 0x31 -- binary: 0011 0001 | |||
local x2 = 0x19 -- binary: 0001 1001 | |||
bitOr(x1, x2) -- return 0011 1001 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Bit_functions}} | {{Bit_functions}} |
Latest revision as of 21:50, 8 January 2016
This function performs a bitwise OR-conjunction on two or more (unsigned) 32-bit integers. See Bitwise operation for more details.
Syntax
uint bitOr ( uint var1, uint var2, ... )
Required arguments
- varN: The value you want to perform an OR-conjunction on
Returns
Returns the conjuncted value.
Example
This example will do a bitwise OR of x1, x2, ...
local x1 = 0x31 -- binary: 0011 0001 local x2 = 0x19 -- binary: 0001 1001 bitOr(x1, x2) -- return 0011 1001