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.
Asked
Active
Viewed 814 times
0
-
1you might have a look here: https://stackoverflow.com/questions/13468474/javascript-convert-a-hex-signed-integer-to-a-javascript-value – Nina Scholz Dec 09 '17 at 18:45
-
How many bits do your integers have (i.e. which one is the MSB)? – Bergi Dec 09 '17 at 19:21
-
1No, you should *not* get your number into a string. Just use bitwise operators. – Bergi Dec 09 '17 at 19:22
-
@Bergi they will be 16-bit – sdev86 Dec 09 '17 at 19:48