0

I'm currently working on a coding challenge that tasks me with converting an integer to a hex value and clearing the MSB. I can use (####).toString(16) to get the integer into a hex but I'm not sure how to clear the MSB.

sdev86
  • 3
  • 2

1 Answers1

0

To unset the MSB in a 16 unsigned integer, just use

value &= 0x7FFF;
Bergi
  • 630,263
  • 148
  • 957
  • 1,375