Bit wise ‘&’ with signed vs unsigned operand

That’s indeed an interesting corner case. It only occurs here because you use uint16_t for the unsigned type when you architecture use 32 bits for ìnt Here is a extract from Clause 5 Expressions from draft n4296 for C++14 (emphasize mine): 10 Many binary operators that expect operands of arithmetic or enumeration type cause conversions … Read more

Mod of power 2 on bitwise operators?

He meant that taking number mod 2^n is equivalent to stripping off all but the n lowest-order (right-most) bits of number. For example, if n == 2, number number mod 4 00000001 00000001 00000010 00000010 00000011 00000011 00000100 00000000 00000101 00000001 00000110 00000010 00000111 00000011 00001000 00000000 00001001 00000001 etc. So in other words, number … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)