質問

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?

役に立ちましたか?

解決

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!

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top