Operators > | (bitwise OR)

| (bitwise OR)

Syntax

expression1 | expression2

Arguments

expression1,expression2 Any number.

Description

Operator (bitwise); converts expression1 and expression2 to 32-bit unsigned integers, and returns a 1 in each bit position where the corresponding bits of either expression1 or expression2 are 1.

Player

Flash 5 or later.

Example

The following is an example of a bitwise OR operation. Note that 15 is 1111 binary:

// 15 decimal = 1111 binary
x = 15;
// 9 decimal = 1001 binary
y = 9;
// x | y = binary
z = x | y;
z = 15 

The following is another way of expressing the preceding example:

15 | 9 returns 15
(1111 | 0011 = 1111)