About 52 results
Open links in new tab
  1. c - What does AND 0xFF do? - Stack Overflow

    The byte1 & 0xff ensures that only the 8 least significant bits of byte1 can be non-zero. if byte1 is already an unsigned type that has only 8 bits (e.g., char in some cases, or unsigned char in most) it …

  2. java - What does "& 0xff" do? - Stack Overflow

    & 0xff is a bitwise AND (image.getRGB(i,j)&0xff) gets the blue value of the rgb encoded int returned by getRGB the > b part check whether it's larger than some threshold

  3. integer - What does value & 0xff do in Java? - Stack Overflow

    In 32 bit format system the hexadecimal value 0xff represents 00000000000000000000000011111111 that is 255(15*16^1+15*16^0) in decimal. and the bitwise & operator masks the same 8 right most …

  4. What is 0xFF and why is it shifted 24 times? - Stack Overflow

    Oct 30, 2010 · What is 0xFF and why is it shifted 24 times? Asked 15 years, 5 months ago Modified 15 years, 5 months ago Viewed 21k times

  5. What's the diffrence between \xFF and 0xFF - Stack Overflow

    Feb 26, 2015 · Difference between '\xFF' and 0xFF is analogous to difference between 'a' and code of character 'a' (Let's assume it is 0x61 for some implementation) with only difference '\xFF' will …

  6. Why do a bitwise-and of a character with 0xff? - Stack Overflow

    May 24, 2021 · The difference is, in the first example you are always passing the lowermost byte at bp to isspace, due to the result of a bitwise AND with a full bitmask (0b11111111 or 0xff).

  7. Why does Java byte[] to int/int to byte[] need operation "&0xFF"

    Mar 3, 2026 · So, even without the & 0xFF the byte will be promoted to int and have its sign extended because of the << or | operation, or simply due to assigning it to an int variable (implicit casting). This …

  8. python - What's 0xFF for in cv2.waitKey (1)? - Stack Overflow

    Feb 12, 2016 · 0xFF is a hexadecimal constant which is 11111111 in binary. By using bitwise AND (&) with this constant, it leaves only the last 8 bits of the original (in this case, whatever cv2.waitKey(0) is).

  9. java - What do >> & and 0xff mean - Stack Overflow

    Feb 1, 2015 · The easy way to do this is with a bitwise and. 0xff can also be written as 0x000000ff, which will set the upper 24 bits to 0, and only turn on the bits in the lower 8 which are already set to 1.

  10. What does "int &= 0xFF" in a checksum do? - Stack Overflow

    Apr 11, 2018 · The final &=0xFF, as you suspected, just truncates the value to the 8LSB of the 32 bit (If that is your compiler's definition of int) value resulting in an unsigned value between 0 and 255. The …