Article Preview
Buy Now
FEATURE
Bitwise Operations for Noobs
Working with bits
Issue: 5.2 (January/February 2007)
Author: Aaron Ballman
Author Bio: Aaron is the self-appointed head of the networking department at REAL Software. In his spare time he likes to hang out with friends, consume frosty beverages, and build nuclear reactors from Legos.
Article Description: No description available.
Article Length (in bytes): 20,667
Starting Page Number: 26
Article Number: 5210
Resource File(s):
5210.zip Updated: 2007-01-15 13:16:46
Related Web Link(s):
http://en.wikipedia.org/wiki/Truth_table
Excerpt of article text...
If you've done any programming with REALbasic before, then chances are pretty good that you've used logical (Boolean) operators before, such as And, Or, & Not. These operators provide you with a logical way to describe a Boolean process. For instance, you may have code which says:
If UserIsAuthorized and OperationIsPermitted then DoOperation( user, operation )
If not ActionFailed then Success( "yay!" )
If Cold or Mild then MsgBox( "It's not hot out" )
These operations read as easy as English and provide your control statements with logic (hence the reason they're called logical operators). However, there's a similar class of operations called Bitwise or Arithmetic operators. These operators are very similar to logical ones in that they provide a means for describing ways of combining two operands. However, instead of involving the Boolean logic of true and false, they involve the mathematical logic of ones and zeros.
...End of Excerpt. Please purchase the magazine to read the full article.