Lesson#33: Decimal to Binary by DEC2BIN function
DEC2BIN converts the Decimal number system to the Binary number system.
The syntax is DEC2BIN(Number, [places]) where Number is the decimal number and [places] is optional. The number of characters to use. If places are omitted, DEC2BIN uses the minimum number of characters necessary. [places] is useful for showing the return value with leading 0s (zeros).
Remarks:
- This function shows a Binary value of decimals up to 9 places, 10 places if the number is negative this means the number should be between (-)512 to (+)511, otherwise DEC2BIN returns the #NUM! error value.
- Converts negative integer up to -512 and converts by using two’s complement notation.
- If the number is nonnumerical, DEC2BIN returns the #VALUE! error value.
- If you have mentioned the places in the function and it requires more than place characters, it returns the #NUM! error value.
- If the place is not an integer, it shows #NAME. error.
- If the place is nonnumerical, DEC2BIN returns the #VALUE! error value.
- If the place is zero or negative, DEC2BIN returns the #NUM! error value.
Leave a Reply