
Bitwise Logic
Get flash to fully experience Pearltrees
Strictly speaking, bit strings are not nearly as easy to understand as named boolean variables; but there are situations when they can simplify or eliminate the need for long boolean expressions. Consider my recent post about the ShortcutManager . There are three control keys that may or may not be pressed at any given time. This amounts to 8 possible key combinations (7 if you ignore when none of them are pressed). Here’s what this would look like if you used a boolean expression to check for each of the possible combinations: That might not seem too bad, and it isn’t that hard to understand what’s going on (even without the comments).
Using Bit-wise Math to Simplify Logic -
Tutorials - Bitwise Operators and Bit Manipulations in C and C
Generally, as a programmer you don't need to concern yourself about operations at the bit level. You're free to think in bytes, or ints and doubles, or even higher level data types composed of a combination of these. But there are times when you'd like to be able to go to the level of an individual bit. Exclusive-or encryption is one example when you need bitwise operations.C# Logical Bitwise Operators :: BlackWasp Software Development
The ninth part of the C# Fundamentals tutorial extends upon the previous article dealing with C# Boolean operators. Boolean operations may also be carried out on integer representations of binary numbers. This article considers logical bitwise operators. In the previous part of the C# Fundamentals tutorial I described the Boolean operators and their effect on Boolean values. The bitwise logic operators provide the same logical AND , OR and XOR functions for operation on each bit of integer values.Bitwise Math - ITPedia
Double bitwise NOT (~~)
Bit Twiddling Hacks
Individually, the code snippets here are in the public domain (unless otherwise noted) — feel free to use them however you please. The aggregate collection and descriptions are © 1997-2005 Sean Eron Anderson. The code and descriptions are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY and without even the implied warranty of merchantability or fitness for a particular purpose. As of May 5, 2005, all the code has been tested thoroughly.Bitwise Operations in C
Introduction After writing the Game Programming Genesis series , I got a lot of E-mail from people asking me to clarify the bitwise operations I used in the sample programs. I use them all over the place in my code, enough that I don't really think about what I'm writing anymore, and so I neglected the fact that a lot of people don't see them used too often. This article is meant to be a complete introduction to bitwise manipulations using the C programming language. If you don't know C, no big deal.labs » Bitwise gems – fast integer math
Introduction This article demonstrates a simple use of bit fields as flags for Windows forms. Bit fields allow packaging of data into simple structures, and they are particularly useful when bandwidth, memory or data storage is at a premium. This might not appear to be an issue with modern day equipment or every day applications, but we can save up to 16 times more memory and storage when using bit fields instead of other value types such as boolean.

