About 50 results
Open links in new tab
  1. How does bitshifting work in Java? - Stack Overflow

    I have this statement: Assume the bit value of byte x is 00101011. what is the result of x>>2? How can I program it and can someone explain me what is doing?

  2. How Does The Bitwise & (AND) Work In Java? - Stack Overflow

    Jun 23, 2013 · The | operator is a bitwise "Or". The result is the bits that are turned on in either of the numbers. 1001 | 1100 = 1101, since only the second bit from the right is zero in both. There are also …

  3. bit manipulation - Bitwise Multiply and Add in Java - Stack Overflow

    Feb 4, 2011 · The key to understanding the logic encapsulated in bitwiseAdd is found in the relationship between addition operations and xor and and bitwise operations. That relationship is defined by the …

  4. Java Operators : |= bitwise OR and assign example [duplicate]

    Oct 22, 2013 · I just going through code someone has written and I saw |= usage, looking up on Java operators, it suggests bitwise or and assign operation, can anyone explain and give me an example …

  5. Bit shift operations on a byte array in Java - Stack Overflow

    Mar 12, 2015 · Bit shift operations on a byte array in Java Asked 10 years, 9 months ago Modified 2 years, 8 months ago Viewed 24k times

  6. What does the ^ operator do in Java? - Stack Overflow

    Jan 2, 2010 · It is the Bitwise xor operator in java which results 1 for different value of bit (ie 1 ^ 0 = 1) and 0 for same value of bit (ie 0 ^ 0 = 0) when a number is written in binary form. ex :- To use your …

  7. java - What are bitwise operations? - Stack Overflow

    Apr 23, 2013 · Bitwise AND of each bit of 0 0000 1010 with 1 1111 0100 results in 0. You can use System.out.println(Integer.toBinaryString(number)); to print the bit pattern and check.

  8. bit manipulation - Java: Are bitwise OR and AND FASTER than the ...

    Jun 15, 2012 · Bitwise operators avoid branching instructions, even in Java code execution. As a result you have no expensive branch prediction misses and no jumps at all. From my experience, they can …

  9. Is it possible to perform bit operations on a float in Java?

    May 28, 2016 · While you cannot directly apply bit operations to a float, it is possible to convert a float to an integer with the same bit representation (to clarify: the bits will be equal, the number value will not).

  10. Java bitwise comparison of a byte - Stack Overflow

    Dec 14, 2011 · 7 I have a value DB of 3 bytes (DB_1, DB_2, DB_3). I need to check DB_3 for specific bits. For example I have to see if DB_3 == 11X0XXXX Where only bit 4, 6 and 7 should be checked. …