convert/base
convert between bases
Calling Sequence
Parameters
Description
Examples
convert(n, 'base', β)
convert(L, 'base', α, β)
n
-
integer; number to be converted
L
list(nonnegint); digits of the base-α number to be converted to base-β
α
posint; base of the input number, whose base-α digits are given in L (least significant first)
β
posint; output base
convert/base converts the base-10 integer n to base-β or converts the list of integers L from base-α to base-β, in which case we interpret L as the number ∑k=1nops⁡L⁡Lk⁢αk−1. It is assumed that 0≤Lk<α.
The result is a list of the base-β digits of the converted input.
Convert numbers in base 10 to any other base. The answer will be given in reverse order (least significant digit first).
convert⁡32,base,16
0,2
The decimal number 17 written in base 3 is 122.
convert⁡17,base,3
2,2,1
Convert the number 122 in base 3 to base 10. The number to be converted must be entered as a list in reverse order unless it is in base 10. The answer will be given in reverse order.
convert⁡2,2,1,base,3,10
7,1
Convert between different bases. The first number after base must be the base in which the number in brackets is given.
convert⁡0,0,0,1,base,2,8
0,1
convert⁡0,1,base,8,16
8
convert⁡0,2,base,16,2
0,0,0,0,0,1
convert⁡0,2,base,16,32
See Also
convert/binary
convert/decimal
convert/hex
convert/octal
Download Help Document