作者:林海书6758 | 来源:互联网 | 2023-09-04 17:22
This question already has an answer here:
这个问题在这里已有答案:
- Is there a C# function that formats a 64bit “Unsigned” value to its equivalent binary value? 2 answers
- 是否有一个C#函数将64位“无符号”值格式化为其等效二进制值? 2个答案
I now want to print on the screen the binary (base 2) representation of a ulong (i.e. something like 0000000000000000000000001, I know that's not enough zeroes)
我现在想在屏幕上打印ulong的二进制(基数2)表示(即类似0000000000000000000000001,我知道不够零)
I just noticed that for some reason there's no Convert.ToString(ulong, base) overload, meaning that I can convert a long into a base2 string representation, but I can't do the same with ulong.
我只是注意到由于某种原因没有Convert.ToString(ulong,base)重载,这意味着我可以将long转换为base2字符串表示,但我不能对ulong做同样的事情。
Is there any other .net method to do this? Is there a reason why this method is not there? (the method is there for uint). Will casting it to a long yield the same results?
有没有其他.net方法来做到这一点?有没有理由不采用这种方法? (该方法适用于uint)。将其投入到长期产量相同的结果?
Thanks a lot =)
非常感谢=)
1 个解决方案