Search This was a Friday lecture, and Friday lectures are often less formal than other days, so we offered the class a choice of several topics. The overwhelming answer was “bits.” Question: What does this do? x; y = x & -x; c = x + y; x = (((x ^ c) >> 2) / y) | c; Wait, ampersand? And plus? And exclusive or? And right-shift? And divide?? With a bitwise-or chaser?! Huh. First, we can tell that x is something like a computer integer type, since it is subject to a bunch of bitwise operators. Here they are.
Read full article from Lecture 12: Bits | CS 207 Blog
No comments:
Post a Comment