FIND THE ANSWERS

How would you write a function to compare specific positions in a binary number?

Answer this question

  • How would you write a function to compare specific positions in a binary number?


Answers

Answer #1 | 08/02 2014 12:12
Using XOR on the two values to be compared will output a mask of the bits that differ across them.
Answer #2 | 08/02 2014 11:45
That's depends on how you are storing your binary number( in array or as a string or long int).
Answer #3 | 10/02 2014 15:20
I'd need to know what language you're using and what format the number is being stored as.

Possible answer