Thread: numeric AND
View Single Post
  #3   Spotlight this post!  
Unread 25-10-2008, 01:37
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,125
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: numeric AND

Be careful about which AND you're talking about though, because there are two distinct types of AND.

Logical AND - "&&": This is the boolean type of AND that you're probably used to seeing. It can be used with numeric types as inputs, but generally translates numeric zeros to FALSE, and non-zero values to TRUE. It will generally output 0 for false, and 1 for true.

Bitwise AND - "&": This will take two numeric inputs, then perform a logical and for each bit in both inputs. For instance if you took two 8-bit binary numbers 11111111 & 00001111 = 00001111. Bitwise ANDs are commonly used for "bitmasking," which is when you only want to take few bits from a number and strip the rest away (make them 0).
__________________
In life, what you give, you keep. What you fail to give, you lose forever...