util.Integer.toBinaryString
Returns the string representation of an INTEGER
, as
an unsigned integer in base 2.
Syntax
util.Integer.toBinaryString(
i INTEGER
)
RETURNS STRING
- i is the source integer value to convert.
Usage
The util.Integer.toBinaryString()
method generates the binary
representation of the integer passed as parameter.
The resulting binary string represents the unsigned integer, in base 2.
Note:
The result has no leading zeros.
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.toBinaryString( 24 ) -- displays "11000"
END MAIN