Bit-wise operations

Element-wise bit operations

dpnp.bitwise_and

Computes the bitwise AND of the underlying binary representation of each element \(x1_i\) of the input array x1 with the respective element \(x2_i\) of the input array x2.

dpnp.bitwise_not

Inverts (flips) each bit for each element \(x_i\) of the input array x.

dpnp.bitwise_or

Computes the bitwise OR of the underlying binary representation of each element \(x1_i\) of the input array x1 with the respective element \(x2_i\) of the input array x2.

dpnp.bitwise_xor

Computes the bitwise XOR of the underlying binary representation of each element \(x1_i\) of the input array x1 with the respective element \(x2_i\) of the input array x2.

dpnp.invert

Inverts (flips) each bit for each element \(x_i\) of the input array x.

dpnp.bitwise_invert

Inverts (flips) each bit for each element \(x_i\) of the input array x.

dpnp.left_shift

Shifts the bits of each element \(x1_i\) of the input array x1 to the left by appending \(x2_i\) (i.e., the respective element in the input array x2) zeros to the right of \(x1_i\).

dpnp.bitwise_left_shift

Shifts the bits of each element \(x1_i\) of the input array x1 to the left by appending \(x2_i\) (i.e., the respective element in the input array x2) zeros to the right of \(x1_i\).

dpnp.right_shift

Shifts the bits of each element \(x1_i\) of the input array x1 to the right according to the respective element \(x2_i\) of the input array x2.

dpnp.bitwise_right_shift

Shifts the bits of each element \(x1_i\) of the input array x1 to the right according to the respective element \(x2_i\) of the input array x2.

dpnp.bitwise_count

Computes the number of 1-bits in the absolute value of x.

Bit packing

Output formatting

dpnp.binary_repr

Return the binary representation of the input number as a string.