Function BAnd() Foundation
Calculates the result of a bitwise AND operation.
BAnd( <nVa1>, <nVal2>, [<nVal3>,...] ) -> nBitwiseAnd
BAnd() returns the result of a bitwise AND operation between operands <nVal1> and <nVal2>. If additional parameters are passed, another bitwise AND operation is performed for each parameter. Once all parameters are processed, BAnd() returns the combined result of the AND operation.
BAnd() is a numeric function that performs a bitwise AND operation between two or more operands. A bitwise AND switches on only those bits in the result which have corresponding bits set in all of the operands. The following table illustrates this correlation.
Operand 1 | Operand 2 | Result |
---|---|---|
0 | 0 | 0 |
1 | 0 | 0 |
0 | 1 | 0 |
1 | 1 | 1 |
Bitwise operations are usually used with flag values, where a certain bit pattern represents a certain option being enabled or disabled. Using the function BAnd(), a flag value can be easily tested for the presence of a certain option.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.