BIN2DEC (Number) BIN2DEC (Number)

Number

Text Text

A binary number.

Returns

Number Number

A decimal number.

Converts a binary number to a decimal number. Negative numbers are written as ten digits in two's complement form. Also consider using the more general function DECIMAL. Perform the reverse conversion using DEC2BIN.

Examples

BIN2DEC ("101")
BIN2DEC ("101")

Returns 5.

BIN2DEC ("01111011")
BIN2DEC ("01111011")

Returns 123.

DECIMAL ("01111011", 2)
DECIMAL ("01111011"; 2)

Returns 123.

BIN2DEC ({ "101", "01111011" })
BIN2DEC ({ "101"; "01111011" })

Returns the array { 5, 123 }{ 5; 123 }.

BIN2DEC ("1111111111")
BIN2DEC ("1111111111")

Returns -1, as the ten-digit binary number is interpreted in two's complement form.

fxEngine Shell Want this in your own terminal? A standalone version is coming. Get notified.
Loading fxEngine Shell