C# - Binary Operations?
-
Hi all! Having some trouble with converting this logic into some nice C# code! can anyone help?? 1. Get the "twos complement" of a number (invert, add 1) 2. Get the LSB of that result... Example with: 1506 1506 = 10111100010 Invert = 01000011101 Add 1 = 01000011110 2*LSB = 00011110 Result = 00011110 (or 1E in hex) Can anyone point me in the right direction to get these results in C# please!
-
Hi all! Having some trouble with converting this logic into some nice C# code! can anyone help?? 1. Get the "twos complement" of a number (invert, add 1) 2. Get the LSB of that result... Example with: 1506 1506 = 10111100010 Invert = 01000011101 Add 1 = 01000011110 2*LSB = 00011110 Result = 00011110 (or 1E in hex) Can anyone point me in the right direction to get these results in C# please!