Erik Movsesyan

Erik Movsesyan

  • NA
  • 62
  • 6.8k

Printing a ulong value in Binary using Convert.ToString()

Apr 16 2022 8:47 PM

Hello!

I am trying to get the binary of a ulong number but it says that It cannot convert from ulong to bool.

The workaround is casting the ulong to long but,

Why can not it do this if It works fine with uint or long etc...

What does bool have to do here?

 

ulong efvenvjnuskl = 18446744073709551615;
Console.WriteLine(Convert.ToString(efvenvjnuskl,2));

 


Answers (1)