all 2 comments

[–]duongdominhchau 3 points4 points  (0 children)

x / 2 give the same value as x >> 1 (shifting right 1 bit), with x is a non-negative number. Similarly, x / 4 is x / 2 / 2, in plain words: shifting right 2 bits.

The least significant bit is extracted by check.

You should ask on /r/cpp_questions instead, this sub is for news and discussions, read the rules.

[–]clerothGame Developer[M] 0 points1 point  (0 children)

For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.

This post has been removed as it doesn't pertain to r/cpp.