Top "Binary" questions

Binary, the base-2 numeral system, represents numbers using two symbols: 0 and 1. For compiled computer programs, use the "executable" tag instead.

Reading binary file and looping over each byte

In Python, how do I read in a binary file and loop over each byte of that file?

python file-io binary
What does the 'b' character do in front of a string literal?

Apparently, the following is the valid syntax: my_string = b'The string' I would like to know: What does this b …

python string unicode binary
How to count the number of set bits in a 32-bit integer?

8 bits representing the number 7 look like this: 00000111 Three bits are set. What are algorithms to determine the number of set …

algorithm binary bit-manipulation hammingweight iec10967
Convert decimal to binary in python

Is there any module or function in python I can use to convert a decimal number to its binary equivalent? …

python binary decimal
How to view files in binary from bash?

I would like to view the contents of a file in the current directory, but in binary from the command …

bash shell binary
What is “2's Complement”?

I'm in a computer systems course and have been struggling, in part, with Two's Complement. I want to understand it …

binary bit-manipulation computer-science twos-complement data-representation
Can I use a binary literal in C or C++?

I need to work with a binary number. I tried writing: const x = 00010000; But it didn't work. I know that …

c++ c binary
Convert string to binary in python

I am in need of a way to get the binary representation of a string in python. e.g. st = "…

python string binary
How to convert 'binary string' to normal string in Python3?

For example, I have a string like this(return value of subprocess.check_output): >>> b'a string' b'a …

python string python-3.x binary
C++ - Decimal to binary converting

I wrote a 'simple' (it took me 30 minutes) program that converts decimal number to binary. I am SURE that there's …

c++ binary decimal