Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static string ConvertToBinary(ulong value)
- {
- if(value==0)
- {
- return "0";
- }
- StringBuilder b = new StringBuilder();
- while(value!=0)
- {
- b.Insert(0,((value&1)==1) ? '1' : '0');
- value>>=1;
- }
- return b.ToString();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement