Skip to content

Binary to denary · ⁨二进制转十进制⁩

English

Binary to denary

Convert a binary number, written as a string, to denary (base 10).

Read the bits from left to right. Each new bit doubles the value so far and then adds itself: for "101" the value goes 1, then 1 * 2 + 0 = 2, then 2 * 2 + 1 = 5. int("1") turns the character into the number 1.

中文

二进制转十进制

把写成字符串的二进制数转换成十进制数。

从左到右读取每一位。每读一位,就把目前的值乘以 2,再加上这一位:对于 "101",值依次是 1、1 * 2 + 0 = 2、2 * 2 + 1 = 5。int("1") 把字符变成数字 1。

Log in or create account · ⁨登录或创建账户⁩

IGCSE, A-Level · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩