OCT2BIN (Number, DigitCount?) OCT2BIN (Number; DigitCount?)

Number

Text Text

An octal number.

DigitCount

Number Number (optional)

The number of digits to return. If omitted, the minimum number of digits necessary to accurately represent the number is used. It is ignored for negative numbers.

Returns

Text Text

A binary number.

Converts an octal number to a binary number. Negative numbers are written as ten digits in two's complement form. Also consider using the more general functions BASE and DECIMAL. Perform the reverse conversion using BIN2OCT.

Examples

OCT2BIN ("5")
OCT2BIN ("5")

Returns "101".

OCT2BIN ("5", 4)
OCT2BIN ("5"; 4)

Returns "0101".

OCT2BIN ("173")
OCT2BIN ("173")

Returns "1111011".

BASE ( DECIMAL ("173", 8), 2)
BASE ( DECIMAL ("173"; 8); 2)

Returns "1111011".

OCT2BIN ({ "5", "173" })
OCT2BIN ({ "5"; "173" })

Returns the array { "101", "1111011" }{ "101"; "1111011" }.

OCT2BIN ("7777777777")
OCT2BIN ("7777777777")

Returns "1111111111", -1 in two's complement form.

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