DEC() Function - Convert Binary Integer to Decimal
Syntax
DEC(string{,ERR=lineref})
Description
The DEC() function converts a binary string argument into a numeric value. The string argument is treated as a signed binary integer.
Parameter |
Description |
---|---|
string |
Binary string to be converted. A null string argument, DEC(""), returns 0. |
ERR=lineref |
Branch to be taken if an error occurs during execution. |
The BIN() function performs the reverse function of DEC(), given the same string size as the original argument.
Examples
>PRINT DEC($0040$)
64
>PRINT DEC($FFC0$)
-64
>PRINT DEC($0400$)
1024