Binary or

The result of -bor is a number where the bits are set in either the value on the left or right.

In the following example, the result is 15:

11 -bor 12 

This operation can be shown in a table:

Bit value

8

4

2

1

Left-hand side

11

1

0

1

1

Right-hand side

12

1

1

0

0

-band

15

1

1

1

1

 

The result is a number made up of the bits from each number where either number has the bit set.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.221.163