Skip to content

Instantly share code, notes, and snippets.

@PradeepLoganathan
Created June 13, 2017 07:02
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 PradeepLoganathan/64048355f441ae5758e8fa1daacbf93d to your computer and use it in GitHub Desktop.
Save PradeepLoganathan/64048355f441ae5758e8fa1daacbf93d to your computer and use it in GitHub Desktop.
Using a binary prefix in C# 7.0
byte b1 = 0b00001111;
byte b2 = 0b10101010;
ushort s1 = 0b1111000011110000;
Console.WriteLine($"{b1:X}");
Console.WriteLine($"{b2:X}");
Console.WriteLine($"{s1:X}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment