位元運算#

逐元素位元運算#

bitwise_and(x1, x2, /[, out, where, ...])

計算兩個陣列的逐元素位元 AND 運算。

bitwise_or(x1, x2, /[, out, where, casting, ...])

計算兩個陣列的逐元素位元 OR 運算。

bitwise_xor(x1, x2, /[, out, where, ...])

計算兩個陣列的逐元素位元 XOR 運算。

invert(x, /[, out, where, casting, order, ...])

計算逐元素位元反轉,或位元 NOT 運算。

bitwise_invert(x, /[, out, where, casting, ...])

計算逐元素位元反轉,或位元 NOT 運算。

left_shift(x1, x2, /[, out, where, casting, ...])

將整數的位元向左位移。

bitwise_left_shift(x1, x2, /[, out, where, ...])

將整數的位元向左位移。

right_shift(x1, x2, /[, out, where, ...])

將整數的位元向右位移。

bitwise_right_shift(x1, x2, /[, out, where, ...])

將整數的位元向右位移。

位元組封裝#

packbits(a, /[, axis, bitorder])

將二進位值陣列的元素封裝成 uint8 陣列中的位元。

unpackbits(a, /[, axis, count, bitorder])

將 uint8 陣列的元素解封裝成二進位值輸出陣列。

輸出格式化#

binary_repr(num[, width])

以字串形式傳回輸入數字的二進位表示。