Skip to content

Latest commit

 

History

History
169 lines (103 loc) · 3.57 KB

oos_util_bit.md

File metadata and controls

169 lines (103 loc) · 3.57 KB

OOS_UTIL_BIT

BITAND Function

bitwise AND

The function signature is similar to bitand

The arguments must be in the range -(2^(32-1)) .. ((2^(32-1))-1). If an
argument is out of this range, the result is undefined.

Syntax

function bitand(
  p_x in binary_integer,
  p_y in binary_integer)
  return binary_integer

Parameters

Name Description
p_x binary_integer
p_y binary_integer
return binary_integer

Example


select oos_util_bit.bitand(1,3)
from dual;

OOS_UTIL_BIT.BITAND(1,3)
------------------------
                      1

BITOR Function

bitwise OR

Copied from http://www.orafaq.com/wiki/Bit

The function signature is similar to bitand

The arguments must be in the range -(2^(32-1)) .. ((2^(32-1))-1). If an
argument is out of this range, the result is undefined.

Syntax

function bitor(
  p_x in binary_integer,
  p_y in binary_integer)
  return binary_integer

Parameters

Name Description
p_x binary_integer
p_y binary_integer
return binary_integer

Example


select oos_util_bit.bitor(1,3)
from dual;

OOS_UTIL_BIT.BITOR(1,3)
-----------------------
                      3

BITXOR Function

bitwise XOR

Copied from http://www.orafaq.com/wiki/Bit

The function signature is similar to bitand

The arguments must be in the range -(2^(32-1)) .. ((2^(32-1))-1). If an
argument is out of this range, the result is undefined.

Syntax

function bitxor(
  p_x in binary_integer,
  p_y in binary_integer)
  return binary_integer

Parameters

Name Description
p_x binary_integer
p_y binary_integer
return binary_integer

Example


select oos_util_bit.bitxor(1,3)
from dual;

OOS_UTIL_BIT.BITXOR(1,3)
------------------------
                       2

BITNOT Function

bitwise NOT

Copied from http://www.orafaq.com/wiki/Bit

The function signature is similar to bitand

The arguments must be in the range -(2^(32-1)) .. ((2^(32-1))-1). If an
argument is out of this range, the result is undefined.

Syntax

function bitnot(
  p_x in binary_integer)
  return binary_integer

Parameters

Name Description
p_x binary_integer
return binary_integer

Example


select oos_util_bit.bitnot(7)
from dual;

OOS_UTIL_BIT.BITNOT(7)
----------------------
                    -8