Skip to main content
Commonmark migration
Source Link

#C, score 5#

C, score 5

Works up to 23, not guaranteed above that.

( ((n+4)>>2)&4 ) + n & 15

((n+4)>>2)&4 returns 4 for n>=12. Add it to n and you get the right answer in the least significant 4 bits, then truncate the other bits.

#C, score 5#

Works up to 23, not guaranteed above that.

( ((n+4)>>2)&4 ) + n & 15

((n+4)>>2)&4 returns 4 for n>=12. Add it to n and you get the right answer in the least significant 4 bits, then truncate the other bits.

C, score 5

Works up to 23, not guaranteed above that.

( ((n+4)>>2)&4 ) + n & 15

((n+4)>>2)&4 returns 4 for n>=12. Add it to n and you get the right answer in the least significant 4 bits, then truncate the other bits.

deleted 5 characters in body
Source Link
Level River St
  • 26.7k
  • 4
  • 37
  • 105

#C, score 5#

Should workWorks up to 23, not guaranteed above that.

( ((n+4)>>2)&4 ) + n & 15

((n+4)>>2)&4 returns 4 for n>12n>=12. Add it to n and you get the right answer in the least significant 4 bits, then truncate the other bits.

#C, score 5#

Should work up to 23, not guaranteed above that.

( ((n+4)>>2)&4 ) + n & 15

((n+4)>>2)&4 returns 4 for n>12. Add it to n and you get the right answer in the least significant 4 bits, then truncate the other bits.

#C, score 5#

Works up to 23, not guaranteed above that.

( ((n+4)>>2)&4 ) + n & 15

((n+4)>>2)&4 returns 4 for n>=12. Add it to n and you get the right answer in the least significant 4 bits, then truncate the other bits.

Source Link
Level River St
  • 26.7k
  • 4
  • 37
  • 105

#C, score 5#

Should work up to 23, not guaranteed above that.

( ((n+4)>>2)&4 ) + n & 15

((n+4)>>2)&4 returns 4 for n>12. Add it to n and you get the right answer in the least significant 4 bits, then truncate the other bits.