Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

Recent questions tagged Bit

0 votes
415 views
1 answer
    I don't fully understand this algorithm of calculating the parity bit. Can someone please explain in detail? The following ... return y & 1; } See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
506 views
1 answer
    Let's say I have these two numbers: x = 0xB7 y = 0xD9 Their binary representations are: x = 1011 0111 y = ... Bitwise, how can I achieve this? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
482 views
1 answer
    I'm under the impression that the Number type in Javascript stores any number, integer or float, according to the ... IEEE). Is this correct? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
484 views
1 answer
    short permissions = 0755; short requested = 0700; short result = permissions & requested; I get a compiler ... (short) permissions & requested See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
688 views
1 answer
    I have 3 unsigned bytes that are coming over the wire separately. [byte1, byte2, byte3] I need to convert ... is using two's complement. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
685 views
1 answer
    Few blob's have been duplicated in my database(oracle 11g), performed XOR operations on the blob using UTL_RAW.BIT_XOR ... in a 32-bit integer? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
512 views
1 answer
    I've just done a test with bitfields, and the results are surprising me. class test1 { public: bool test_a:1; bool ... C++ Builder 2007, btw...) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
675 views
1 answer
    This question: How to de-interleave bits (UnMortonizing?) has a good answer for extracting one of the two halves ... (either scalar or SIMD). See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
338 views
1 answer
    I know that we can use the logic of binary adder where Sum = a XOR b and Carry = a AND b I have ... or multiplied by 2 during each recursion? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
527 views
1 answer
    Which is the simplest way to check if two integers have same sign? Is there any short bitwise trick to do this? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
510 views
1 answer
    I had this in part of the code. Could anyone explain how i & (i ^ (i - 1)) could be reduced to i & (-i)? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
454 views
1 answer
    Is bitfield a C concept or C++? Can it be used only within a structure? What are the other places we can ... OUTPUT: sizeof struct s = 12 bytes See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
517 views
1 answer
    Is there any difference between signed and unsigned variables on bitwise operations? For example,when dealing with ... with signed numbers? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
480 views
1 answer
    In an assignment I am currently working on we need to work with bit vectors, but I am very unsure of how to ... vector and ignoring the 4 bits. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
551 views
1 answer
    What is the most efficient way to de-interleave bits from a 32 bit int? For this particular case, I'm only ... to improve speed or reduce space? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
811 views
1 answer
    What operation does the following C' statement perform? star = star ^ 0b00100100; (A) Toggles bits 2 and 5 of ... . Can someone help me out? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
768 views
1 answer
    How can I set a value of 1 to all bits in an __m256 value? Using either AVX or AVX2 intrinsics? To get ... setzero, followed by a vector NOT. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
751 views
1 answer
    I have a question. uint64_t var = 1; // this is 000000...00001 right? And in my code this works: var ^ (1 << ... var ^ ( (uint64_t) 1 << 43 ) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
798 views
1 answer
    Check whether a number x is nonzero using the legal operators except !. Examples: isNonZero(3) = 1, isNonZero(0) ... we do it without using ! ? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
633 views
1 answer
    I've been reading the classic Hacker's delight and I am having trouble understanding the difference between logical ... doubt seems too simple. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
636 views
1 answer
    Can someone explains why Brian Kernighan's algorithm takes O(log N) to count set bits (1s) in an integer. A simple ... how we get O(log N). See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
691 views
1 answer
    I am working on a user-role / permission system in PHP for a script. Below is a code using a bitmask method for ... echo 'Access denied.'; } ?> See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
571 views
1 answer
    I want to extract bits of a decimal number. For example, 7 is binary 0111, and I want to get 0 1 1 1 all ... , can I do something else for this? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
475 views
1 answer
    I'm a little confused now by java left shift operation, 1<<31 = 0x80000000 --> this I can understand ... effort when compile to instructions. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
404 views
1 answer
    I have the methods that do both the multiplication and addition, but I'm just not able to get my head ... to learn bitwise operations in Java. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
663 views
1 answer
    I know that the following is true int i = 17; //binary 10001 int j = i << 1; //decimal 34, binary ... a single operation, not a for loop. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
496 views
1 answer
    I have a problem with flag bits. I have an int variable to hold flags. First I set some flags to that variable. ... I don't know to do it. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
491 views
1 answer
    Two's complement method - generates -(x + 1). for example when JavaScript encounters the Tilde he uses this method ... where this -6 came from ? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
Ask a question:
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...