Binary Numbers and Representation of Bases

核能气质少年 提交于 2019-12-01 01:32:35

问题


So, binary is just base 2, right? 1s and 0s. But why, when you convert from dec to bin, on Google for example, does it also have an (x)b in front of the actual number? What does the, for example, 0b __ mean?


回答1:


The notation 0b in front of a number is just an indicator that what follows is represented in binary. That way, if you see something like 1001, you know it's the number "one thousand one" rather than nine written out in binary.

More generally, the prefix 0b usually means "binary," the prefix 0 usually means "octal," and the prefix 0x usually means "hexadecimal."

Hope this helps!



来源:https://stackoverflow.com/questions/17535843/binary-numbers-and-representation-of-bases

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!