|
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...
|