SetNumberBase
Sets the preferred number base used to display an integer.
Syntax
-
SetNumberBase(n, b)
-
n
is an integer -
b
is a non-negative integer
-
Description
SetNumberBase(n, b)
returns n
with its number base setting set to b
. If b > 0
, this means that base b
should be used to display the integer. If b = 0
, this means that the default base should be used.
b
must be either 0
or an integer between 2
and 36
(inclusively).
Examples
ToTable(n ≔ 123456; SequenceList(2, 36) @ (b ↦ '(StringPad(string(b), 2, "r"), SetNumberBase(n, b))))
2 11110001001000000 3 20021100110 4 132021000 5 12422311 6 2351320 7 1022634 8 361100 9 207313 10 123456 11 84833 12 5B540 13 44268 14 32DC4 15 268A6 16 1E240 17 18232 18 1330C 19 HIID 20 F8CG 21 D6JI 22 BD1E 23 A38F 24 8M80 25 7MD6 26 70G8 27 679C 28 5HD4 29 51N3 30 4H56 31 44EE 32 3OI0 33 3EC3 34 34R2 35 2URB 36 2N9C