二进制数和基数表示 [英] Binary Numbers and Representation of Bases

查看:168
本文介绍了二进制数和基数表示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那么,二进制只是2的基数,对不对? 1s和0s.但是,为什么在您从dec转换为bin时(例如在Google上),在实际数字前面也有(x)b呢?例如,0b __ 是什么意思?

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?

推荐答案

数字前面的符号0b只是一个指示符,表明随后的内容以二进制表示.这样,如果您看到类似1001的内容,就知道它是数字"001",而不是以二进制形式写成9.

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.

通常,前缀0b通常表示二进制",前缀0通常表示八进制",而前缀0x通常表示十六进制".

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

希望这会有所帮助!

这篇关于二进制数和基数表示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆