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.

bad operand types for binary operator "&" java

The error shows this line if ((a[0] & 1 == 0) && (a[1] & 1== 0) && (a[2] & 1== 0)){ This is the whole …

java binary operand
Convert a binary NodeJS Buffer to JavaScript ArrayBuffer

How can I convert a NodeJS binary buffer into a JavaScript ArrayBuffer?

javascript node.js binary buffer arraybuffer
Count number of 1's in binary representation

Efficient way to count number of 1s in the binary representation of a number in O(1) if you have enough …

algorithm binary
C# binary literals

Is there a way to write binary literals in C#, like prefixing hexadecimal with 0x? 0b doesn't work. If not, …

c# syntax binary
Convert string to binary then back again using PHP

Is there a way to convert a string to binary then back again in the standard PHP library? To clarify …

php binary
Bitwise operation and usage

Consider this code: x = 1 # 0001 x << 2 # Shift left 2 bits: 0100 # Result: 4 x | 2 # Bitwise OR: 0011 # Result: 3 x & 1 # Bitwise AND: 0001 # Result: 1 …

python binary operators bit-manipulation
Remove 'b' character do in front of a string literal in Python 3

I am new in python programming and i am a bit confused. I try to get the bytes from a …

python string encryption binary
Reading integers from binary file in Python

I'm trying to read a BMP file in Python. I know the first two bytes indicate the BMP firm. The …

python file binary integer
How to reverse an std::string?

Im trying to figure out how to reverse the string temp when I have the string read in binary numbers …

c++ string binary reverse
How to get 0-padded binary representation of an integer in java?

for example, for 1, 2, 128, 256 the output can be (16 digits): 0000000000000001 0000000000000010 0000000010000000 0000000100000000 I tried String.format("%16s", Integer.toBinaryString(1)); it puts spaces for left-padding: ` 1…

java binary string-formatting