paxC Bitwise Operators

Language Element Short Description
Bitwise AND Operator (&) Performs a bitwise AND on two expressions.
Bitwise Left Shift Operator (<<) Left shifts the bits of an expression.
Bitwise NOT Operator (~) Performs a bitwise NOT (negation) on an expression.
Bitwise OR Operator (|) Performs a bitwise OR on two expressions.
Bitwise Right Shift Operator (>>) Right shifts the bits of an expression.
Bitwise Unsigned Right Shift Operator (>>>) Right shifts the bits of an expression, without maintaining sign.
Bitwise XOR Operator (^) Performs a bitwise exclusive OR on two expressions.

Bitwise AND Operator (&)

Performs a bitwise AND on two expressions.
result = expression1 & expression2

Arguments

result
Any variable.
expression1, expression2
Any expressions.
The & operator looks at the binary representation of the values of two expressions and does a bitwise AND operation on them. If one or both expressions are Null expressions, result is Null.

Bitwise Left Shift Operator (<<)

Left shifts the bits of an expression.
result = expression1 << expression2

Arguments

result
Any variable.
expression1, expression2
Any expressions.
The << operator looks at the binary representation of the values of two expressions and does a bitwise left shift operation on them. If one or both expressions are Null expressions, result is Null.

Bitwise NOT Operator (~)

Performs a bitwise NOT (negation) on an expression.
result = ~ expression

Arguments

result
Any variable.
expression
Any expressions.
The ~ operator looks at the binary representation of the values of expression and does a bitwise not operation on it. If one or both expressions are Null expressions, result is Null.

Bitwise OR Operator (|)

Performs a bitwise OR on two expressions.
result = expression1 | expression2

Arguments

result
Any variable.
expression1, expression2
Any expressions.
The | operator looks at the binary representation of the values of two expressions and does a bitwise AND operation on them. If one or both expressions are Null expressions, result is Null.

Bitwise Right Shift Operator (>>)

Right shifts the bits of an expression.
result = expression1 >> expression2

Arguments

result
Any variable.
expression1, expression2
Any expressions.
The >> operator looks at the binary representation of the values of two expressions and does a bitwise right shift operation on them. If one or both expressions are Null expressions, result is Null.

Bitwise Unsigned Right Shift Operator (>>>)

Right shifts the bits of an expression, without maintaining sign.
result = expression1 >>> expression2

Arguments

expression1, expression2
Any expressions.
The >>> operator looks at the binary representation of the values of two expressions and does a bitwise right shift operation on them, without maintaining sign. If one or both expressions are Null expressions, result is Null.

Bitwise XOR Operator (^)

Performs a bitwise exclusive OR on two expressions.
result = expression1 ^ expression2

Arguments

result
Any variable.
expression1, expression2
Any expressions.
The ^ operator looks at the binary representation of the values of two expressions and does a bitwise exclusive OR operation on them. If one or both expressions are Null expressions, result is Null.


Copyright © 1999-2006 VIRT Laboratory. All rights reserved.