Bitwise AND (&) Expression Summary Evaluate with a logical AND operation. Syntax expression1 & expression2 Parameters expression1 Any legal Boolean or numeric expression. expression2 Any legal Boolean or numeric expression. Description For numeric and Boolean expressions, the & operator computes the values of the operands, converts them to equal-length binary representations, performs a logical AND operation on them, and returns the evaluated result. For example, the decimal (base 10) number 0 (zero) may be converted to the binary form 0000 and the number 1 (one) may be converted to 0001. The bitwise AND operation will compare each bit. If both bits are 1 (one), the resulting bit is 1 (one); otherwise, the resulting bit is 0 (zero). For example, here is an illustration of the evaluation of the expression 0 & 1: 1234 0000 (0) 0001 (1) ----= 0000 (0) Here is an illustration for the evaluation of the expression 0 & 5: 1234 0001 (1) 0101 (5) ----= 0001 (1) Differences from JavaScript Logical AND operations are not limited to 32-bit integers in JS++. Unimplemented In JavaScript, the logical AND operation is limited to signed 32-bit integers. Examples Basic Usage 1234import System; Console.log(0 & 1); // 0Console.log(1 & 5); // 1 See Also Bitwise AND Assignment Operator Bitwise OR Operator Bitwise XOR Operator Share HTML | BBCode | Direct Link