Bitwise OR (|) Expression Summary Evaluate with a logical inclusive OR 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 inclusive OR 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 OR operation will compare each bit. If both bits are 0 (zero), the resulting bit is 0 (zero); otherwise, the resulting bit is 1 (one). For example, here is an illustration of the evaluation of the expression 0 | 1: 1234 0000 (0) 0001 (1) ----= 0001 (1) Here is an illustration for the evaluation of the expression 3 | 5: 1234 0011 (3) 0101 (5) ----= 0111 (7) Differences from JavaScript Logical OR operations are not limited to 32-bit integers in JS++. Unimplemented In JavaScript, the logical OR operation is limited to signed 32-bit integers. Examples Basic Usage 12345import System; Console.log(0 | 0); // 0Console.log(0 | 1); // 1Console.log(1 | 5); // 5 See Also Bitwise OR Assignment Operator Bitwise AND Operator Bitwise XOR Operator Share HTML | BBCode | Direct Link