convert/decimal - Maple Programming Help

Home : Support : Online Help : Programming : Data Types : Conversion : convert/decimal

convert/decimal

convert to base 10

 Calling Sequence convert(n, decimal, b)

Parameters

 n - integer, floating-point number, symbol, or string b - integer from 2 to 36 or one of binary, octal, hexadecimal, or hex

Description

 • The function convert(n, decimal, b) converts a base b number where b is an integer from 2 through 36) to a decimal number.  If n is a symbol or a string, it is assumed to be in the form of a either an integer or a floating-point number. The letters a (or A) through z (or Z) represent the digit values $10$ through $35$, respectively. The digits used are not required to be less than the base, so 38B base 4 is equivalent to 1123 base 4, each being converted to the decimal value $91$.
 • The keywords binary, octal, hexadecimal, and hex represent bases $2$, $8$, $16$, and $16$, respectively.

Examples

 > $\mathrm{convert}\left(101,\mathrm{decimal},\mathrm{binary}\right)$
 ${5}$ (1)
 > $\mathrm{convert}\left(-23,\mathrm{decimal},\mathrm{octal}\right)$
 ${-19}$ (2)
 > $\mathrm{convert}\left("1A.C",\mathrm{decimal},\mathrm{hex}\right)$
 ${26.75000000}$ (3)
 > $\mathrm{convert}\left("F39GA.CLH",\mathrm{decimal},24\right)$
 ${5.023690538}{}{{10}}^{{6}}$ (4)
 > $\mathrm{convert}\left("HELLO.WORLD",\mathrm{decimal},36\right)$
 ${2.923465291}{}{{10}}^{{7}}$ (5)