We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d0bce6 commit 79068b9Copy full SHA for 79068b9
commpy/utilities.py
@@ -46,12 +46,12 @@ def dec2bitarray(in_number, bit_width):
46
Array containing the binary representation of all the input decimal(s).
47
48
"""
49
- result = np.zeros(size, 'int')
+ result = np.zeros(bit_width, 'int')
50
i = 1
51
pox = 0
52
- while i <= number:
53
- if i & number:
54
- result[size - pox - 1] = 1
+ while i <= in_number:
+ if i & in_number:
+ result[bit_width - pox - 1] = 1
55
i <<= 1
56
pox += 1
57
return result
0 commit comments