Some code from the reflector
byte[] expr_239_cp_0 = this.buf; int expr_239_cp_1 = num; expr_239_cp_0[expr_239_cp_1] |= 1; What operation |=1 ?
Some code from the reflector
byte[] expr_239_cp_0 = this.buf; int expr_239_cp_1 = num; expr_239_cp_0[expr_239_cp_1] |= 1; What operation |=1 ?
Operator | = - performs a bitwise OR operation.
Record
x |= 1 is equivalent to
x = x | 1 When used with parameter 1, the number on the left is set to the last bit to 1.
Since this is a bitwise operation, the operands for it are sets of bits, which means that the record 100 | 192 100 | 192 will be performed as follows
01100100 11000000 -------- 11100100 And it will be equal to 228 .
Source: https://ru.stackoverflow.com/questions/586988/
All Articles