J Jon Skeet [C# MVP] Nov 20, 2003 #2 Dave Searle said: Is there an easy way to get the binary representation of an int? Click to expand... Use Convert.ToString (myValue, 2);
Dave Searle said: Is there an easy way to get the binary representation of an int? Click to expand... Use Convert.ToString (myValue, 2);
D Dave Searle Nov 20, 2003 #3 Excellent, Thanks. -----Original Message----- Use Convert.ToString (myValue, 2); -- Jon Skeet - <[email protected]> http://www.pobox.com/~skeet If replying to the group, please do not mail me too . Click to expand...
Excellent, Thanks. -----Original Message----- Use Convert.ToString (myValue, 2); -- Jon Skeet - <[email protected]> http://www.pobox.com/~skeet If replying to the group, please do not mail me too . Click to expand...
P Paul Robson Nov 20, 2003 #4 Dave said: Is there an easy way to get the binary representation of an int? Click to expand... string result = ""; do { result = ((n % 2 == 0) ? "0" : "1")+result; n = n / 2; } while (n != 0);
Dave said: Is there an easy way to get the binary representation of an int? Click to expand... string result = ""; do { result = ((n % 2 == 0) ? "0" : "1")+result; n = n / 2; } while (n != 0);