BITWISE
\bˈɪtwa͡ɪz], \bˈɪtwaɪz], \b_ˈɪ_t_w_aɪ_z]\
Sort: Oldest first
-
A bitwise operator treats its operands as avector of bits rather than a single number. Booleanbitwise operators combine bit N of each operand using aBoolean function (NOT, AND, OR, XOR) to produce bitN of the result.For example, a bitwise AND operator ("&" in C) wouldevaluate 13 & 9 as (binary) 1101 & 1001 = 1001 = 9, whereas,the logical AND, (C "&&") would evaluate 13 && 9 as TRUE &&TRUE = TRUE = 1.In some languages, e.g. Acorn's BASIC V, the same operatorsare used for both bitwise and logical operations. Thisusually works except when applying NOT to a value x which isneither 0 (false) nor -1 (true), in which case both x and (NOTx) will be non-zero and thus treated as TRUE.Other operations at the bit level, which are not normallydescribed as "bitwise" include shift and rotate.
By Denis Howe