Most voted "bit" questions
Bit is the smallest unit of information that can be stored or transmitted. Used in Computation and Information Theory. A bit can assume only 2 values, for example: 0 or 1, true or false.
Learn more…17 questions
Sort by count of
-
20
votes1
answer432
viewsWhat is the ~ (til) operator for in PHP?
What is the operator for ~ (til) in PHP? I’ve seen things like: echo ~PHP_INT_MAX Until then I thought it was to "reverse" a number to negative, or something like that, but with the tests I saw that…
-
18
votes8
answers2184
viewsHow to know all possible combinations of 0 and 1 in Java?
What possible combinations can I get only with numbers 0 and 1 using 5 digits (digits)? For example: 00000 00001 00011 ... 11111. I wanted to keep all the combinations, but I don’t know how to find…
-
14
votes2
answers23232
views -
12
votes1
answer1922
views -
9
votes1
answer2493
viewsWhat are logical operators and how do bit-to-bit operations work in the C language?
What are logical operators NOT, AND, OR, XOR, in language C? Nor did I understand these operators: ~, &, |, ^, >>, << and the result in bits. I have the following example of code:…
-
9
votes1
answer855
views -
5
votes1
answer2819
viewsMinimum bits required to represent a natural number
What is the most performative way to find the minimum number of bits needed to represent a natural number (i.e. no signal) in Javascript? There is a way to do without using loops? The code below for…
-
5
votes2
answers147
viewsIn Java because (250 >> 4) is more optimized than (250 / 16)
I’m taking a Java course and in a class the teacher said that this code: int xstart = Camera.x >> 4; int ystart = Camera.y >> 4; is more "fast or optimized" than this code: int xstart =…
-
4
votes1
answer101
viewsGet the least significant bit of an integer in Java
I’m trying to do a bit manipulation in java, but I have a certain problem. I’m storing any number in an int and trying to get the least significant bit of it, but I don’t know how to do that. For…
-
2
votes2
answers1130
viewsHow to replace 1 bit of an integer without changing the other neighboring bits?
I want to change 1 bit and keep the same values of the other neighboring bits. The bit operator shifts to the left or right by changing the bit of 1 pair 0, but it changes the entire 8-bit sequence.…
-
2
votes1
answer346
viewsArray of Boolean for Integer
How can I transform a Boolean array, boolean[] bits in his Integer correspondent? I have a function that does exactly the opposite, but I didn’t understand it enough to be able to reverse it. int…
-
2
votes1
answer132
views -
2
votes1
answer347
viewsUsing "bytes" and "bits"
What use bytes and bits? I’m reading some C and C++ programming books that talk about bytes and I wanted to know what the use is or what these terms are for. For example, this table below talks…
-
0
votes2
answers63
viewsOperator Bitwise Right
Hello Conducting some studies on PHP I came across bitwise and until then all its operations has not been anything difficult, just the one of the right shift An exmeplo I took and I still don’t…
-
0
votes1
answer80
viewsSocket Hex with checksum
I’m developing a communication socket between a tracker and the server. The socket is working perfectly. My problem is with communication when it comes to checking the checksum. The device sends a…
-
0
votes1
answer237
viewsWhat is bit-a-bit operation?
I’ve read some things here at Stack Overflow, but I don’t quite understand. What is bit-to-bit operation? For example, in the context: Considering bit-to-bit operation 15 3, the result will be:…
bitasked 6 years, 5 months ago Lucas de Carvalho 6,427 -
-3
votes2
answers323
viewsHow to isolate higher order bits and lower order bits in C/C++?
I need to create two functions One receives an integer value and returns another one containing only the 8 bits of the lowest order of the original value, with the remaining bits set to zero. The…