Difference between revisions of "BITOR()"
Yvonne.milne (Talk | contribs) m (1 revision) |
Helen.george (Talk | contribs) |
||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Function to perform bitwise OR operation | Function to perform bitwise OR operation | ||
− | |||
==Syntax== | ==Syntax== | ||
BITOR(<expN1>,<expN2>[,...<expN26>]) | BITOR(<expN1>,<expN2>[,...<expN26>]) | ||
− | |||
==See Also== | ==See Also== | ||
[[BITAND()]], [[BITCLEAR()]], [[BITLSHIFT()]], [[BITNOT()]], [[BITRSHIFT()]], [[BITSET()]], [[BITTEST()]], [[BITXOR()]] | [[BITAND()]], [[BITCLEAR()]], [[BITLSHIFT()]], [[BITNOT()]], [[BITRSHIFT()]], [[BITSET()]], [[BITTEST()]], [[BITXOR()]] | ||
− | |||
==Description== | ==Description== | ||
Line 15: | Line 12: | ||
BITOR() compares each bit in turn of <expN1> and <expN2>. If either bit is 1, the corresponding bit in the result is set to 1: if both bits are 0, the result bit is 0. If <expN3> is specified, the initial result is compared bit by bit with <expN3> and a new result evaluated. This new result is then compared with <expN4>, if specified, and so on. | BITOR() compares each bit in turn of <expN1> and <expN2>. If either bit is 1, the corresponding bit in the result is set to 1: if both bits are 0, the result bit is 0. If <expN3> is specified, the initial result is compared bit by bit with <expN3> and a new result evaluated. This new result is then compared with <expN4>, if specified, and so on. | ||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 29: | Line 25: | ||
|- | |- | ||
|} | |} | ||
− | |||
==Example== | ==Example== | ||
Line 43: | Line 38: | ||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:Bitwise Operations]] | [[Category:Bitwise Operations]] | ||
[[Category:Bitwise Operations Functions]] | [[Category:Bitwise Operations Functions]] |
Revision as of 11:34, 7 December 2012
Contents
Purpose
Function to perform bitwise OR operation
Syntax
BITOR(<expN1>,<expN2>[,...<expN26>])
See Also
BITAND(), BITCLEAR(), BITLSHIFT(), BITNOT(), BITRSHIFT(), BITSET(), BITTEST(), BITXOR()
Description
The BITOR() function performs a bitwise OR operation on the specified numeric parameters. Up to 26 parameters can be specified. These parameters, if not integers, will be converted to integer values before the operation takes place.
BITOR() compares each bit in turn of <expN1> and <expN2>. If either bit is 1, the corresponding bit in the result is set to 1: if both bits are 0, the result bit is 0. If <expN3> is specified, the initial result is compared bit by bit with <expN3> and a new result evaluated. This new result is then compared with <expN4>, if specified, and so on.
<expN1> bit | <expN2> bit | Result bit |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 1 | 1 |
1 | 0 | 1 |
Example
x = 3 && 0011 y = 6 && 0110 z = 7 && 0111 ? bitor(x,y) 7 && 0111 ? bitor(x,y,z) 7 && 0111