8.6. Bitwise Functions
8.6.1. BIN_AND()
Available in
DSQL, PSQL
Possible name conflict
YES → Read details
Syntax
BIN_AND (number, number [, number ...])
Parameter | Description |
---|---|
number | Any integer number (literal, smallint/integer/bigint, numeric/decimal with scale 0) |
Result type
SMALLINT
, INTEGER
or BIGINT
|
Description
Returns the result of the bitwise AND operation on the argument(s).
See also
8.6.2. BIN_NOT()
Available in
DSQL, PSQL
Possible name conflict
NO
Syntax
BIN_NOT (number)
Parameter | Description |
---|---|
number | Any integer number (literal, smallint/integer/bigint, numeric/decimal with scale 0) |
Result type
SMALLINT
, INTEGER
or BIGINT
|
Description
Returns the result of the bitwise NOT operation on the argument, i.e. ones complement.
See also
BIN_OR()
, BIN_XOR()
and others in this set.
8.6.3. BIN_OR()
Available in
DSQL, PSQL
Possible name conflict
YES → Read details
Syntax
BIN_OR (number, number [, number ...])
Parameter | Description |
---|---|
number | Any integer number (literal, smallint/integer/bigint, numeric/decimal with scale 0) |
Result type
SMALLINT
, INTEGER
or BIGINT
|
Description
Returns the result of the bitwise OR operation on the argument(s).
See also
8.6.4. BIN_SHL()
Available in
DSQL, PSQL
Syntax
BIN_SHL (number, shift)
Parameter | Description |
---|---|
number | A number of an integer type |
shift | The number of bits the number value is shifted by |
Result type
BIGINT
Description
Returns the first argument bitwise left-shifted by the second argument, i.e. a << b
or a·2b
.
See also
8.6.5. BIN_SHR()
Available in
DSQL, PSQL
Syntax
BIN_SHR (number, shift)
Parameter | Description |
---|---|
number | A number of an integer type |
shift | The number of bits the number value is shifted by |
Result type
BIGINT
Description
Returns the first argument bitwise right-shifted by the second argument, i.e. a >> b
or a/2b
.
- The operation performed is an arithmetic right shift (SAR), meaning that the sign of the first operand is always preserved.
See also
8.6.6. BIN_XOR()
Available in
DSQL, PSQL
Possible name conflict
YES → Read details
Syntax
BIN_XOR (number, number [, number ...])
Parameter | Description |
---|---|
number | Any integer number (literal, smallint/integer/bigint, numeric/decimal with scale 0) |
Result type
SMALLINT
, INTEGER
or BIGINT
|
Description
Returns the result of the bitwise XOR operation on the argument(s).
See also