Join the DZone community and get the full member experience.Join For Free
A while back I wrote an article titled "The Great Mystery of the Tilde" where I tried to explain what the
Setting the Facts Straight
Normally, I don't care too much about going back and updating old content, but my error was quite egregious. Not only that: that post is the second most view post I had last year, so if I'm going to have that much traffic going to it, then I need to fix it, so I've added a paragraph to that post directing visitors to this new post, so that I can prevent future misinformation from spreading.
So, What Is It?
8, it looks like this in binary:
1000. When you use the
~ on that number, it will convert each bit to the opposite value. That means, each
1 will become a
0 and vice versa. So
~8 would equal
7, whose binary representation looks like this:
0111. Or a
1101) would become 2 (
-9. If you want a better explanation than that, you'll need to do some research on your own because I don't feel adequate to explain it.
So now I hope this sets the record straight and that people being directed to the old post by Google will end up seeing this post. God bless and happy coding!
Published at DZone with permission of Joseph Zimmerman, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.