util.Integer.or
Returns the result of a bitwise OR on two INTEGER
values.
Syntax
util.Integer.or(
x INTEGER,
y INTEGER
)
RETURNS INTEGER
- x is an integer value.
- y is an integer value.
Usage
The
util.Integer.or()
method makes a bitwise OR operation with the integer
values passed as
parameter: x : 210 (00000000 00000000 00000000 11010010)
y : 135 (00000000 00000000 00000000 10000111)
--------------------------------------------------
result : 215 (00000000 00000000 00000000 11010111)
Note: Bitwise methods provided by the
util.Integer
class are
based on the INTEGER
type. Consider the following facts when using these methods: - The
INTEGER
type is a four-byte signed integer: If the bit at position 31 is set to 1, the correspondingINTEGER
value will be negative. Thus,util.Integer.not(0)
produces theINTEGER
value-1
(11111111 11111111 11111111 11111111
). - The
NULL
value for theINTEGER
type is represented internally with the value0x80000000
(10000000 00000000 00000000 00000000
). WhenNULL
is used with theutil.Integer
bitwise methods, it will be interpreted as0x80000000
instead of a null value. However, if the result of the bitwise operation produces the value0x80000000
, it will be interpreted asNULL
when used in an expression.
Example
IMPORT util
MAIN
DISPLAY util.Integer.or( 4, 2 ) -- displays 6
END MAIN