And

(Engine-Level Function)

Description: Returns the bit-wise AND of its parameters.
Returns: Signed 64-bit integer
Usage: Script or steady state.
Function Groups: Bitwise Operation
Related to: Or | Not | XOr
Format: And(Parm1, Parm2[, Parm3...])
Parameters:  
Parm1, Parm2[, Parm3 ...])
Required. Any number of numeric expressions.
Comments:

This operation compares the bits of its parameters and returns a result where each bit is only 1 if that bit in every included parameter is 1. If a bit in one or more parameter is 0, that bit will be 0 in the result.

This function takes signed 64-bit integers values. If a number is passed outside the range of a signed 64-bit integer, then the function will return invalid. If Value is invalid, the return value is invalid.

When doing bitwise comparisons, always use AND rather than &&. The double-ampersand operator does not make bitwise comparisons.

(See: Bitwise Parameters & Operations)

Example:

  result = And(0b1010, 0b1100);

This example sets the variable result to 0b1000.