Skip to content

Instantly share code, notes, and snippets.

@ircmaxell
Created July 28, 2018 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ircmaxell/a9bfb2dd437458b89250d7190d0c2712 to your computer and use it in GitHub Desktop.
Save ircmaxell/a9bfb2dd437458b89250d7190d0c2712 to your computer and use it in GitHub Desktop.
0-A-B != REVERSE(0-REVERSE(A)-REVERSE(B))
Hex Dec Binary
A = A0 160 10100000
B = 4C 76 01001100
0 - A
FFFFFF60 -160 1111111101100000 (lowest 16 bits)
0 - A - B
FFFFFF20 -236 1111111100010100 (lowest 16 bits)
Lowest 8 bits of 0-A-B: 00010100
REVA = 05 5 00000101
REVB = 32 50 00110010
0 - REVA
FFFFFFFB -5 1111111111111011
0 - REVA - REVB
FFFFFFC9 -55 1111111111001001
Lowest 8 bits of 0 - REVA - REVB: 11001001
Reversed Lowest 8 bits of 0 - REVA - REVB: 10010011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment