BIN2OCT (binary number to octal number)

<< Click to Display Table of Contents >>

BIN2OCT (binary number to octal number)

Syntax:

BIN2OCT(Number [, Digits])

Description:

Converts the given binary number (base 2) to an octal number (base 8).

Number is the number to be converted.

Negative numbers have to be transformed to two's complement notation (see last example).

Number must not contain more than 32 places, so the permissible value range is:

-(2^31) ≤ Number ≤ (2^31)-1

The optional argument Digits lets you specify the number of places to be displayed. If omitted, PlanMaker determines the number of required places automatically.

Digits must be greater than zero. Digits should be an integer. Digits to the right of the decimal point are ignored.

If Digits is smaller than the minimum number of places required to display the number, the function returns a #NUM error value.

If Number is negative, the result is represented in 32-bit two's complement; the Digits argument is ignored in this case.

Example:

BIN2OCT("101010") returns 52

BIN2OCT("00101010") returns 52 as well

BIN2OCT("101010", 1) results in the error value #NUM!, because this number can only be represented with at least 2 digits

BIN2OCT("11111111111111111111111111010110") returns 37777777726 (negative value)

See also:

OCT2BIN, BIN2DEC, BIN2HEX