3
basecvt - radix conversion for arbitrary precision integers
7
basecvt <ibase> <obase> [values]
11
The B<basecvt> program is a command-line tool for converting integers
12
of arbitrary precision from one radix to another. The current version
13
supports radix values from 2 (binary) to 64, inclusive. The first two
14
command line arguments specify the input and output radix, in base 10.
15
Any further arguments are taken to be integers notated in the input
16
radix, and these are converted to the output radix. The output is
17
written, one integer per line, to standard output.
19
When reading integers, only digits considered "valid" for the input
20
radix are considered. Processing of an integer terminates when an
21
invalid input digit is encountered. So, for example, if you set the
22
input radix to 10 and enter '10ACF', B<basecvt> would assume that you
23
had entered '10' and ignore the rest of the string.
25
If no values are provided, no output is written, but the program
26
simply terminates with a zero exit status. Error diagnostics are
27
written to standard error in the event of out-of-range radix
28
specifications. Regardless of the actual values of the input and
29
output radix, the radix arguments are taken to be in base 10 (decimal)
34
For radices from 2-10, standard ASCII decimal digits 0-9 are used for
35
both input and output. For radices from 11-36, the ASCII letters A-Z
36
are also included, following the convention used in hexadecimal. In
37
this range, input is accepted in either upper or lower case, although
38
on output only lower-case letters are used.
40
For radices from 37-62, the output includes both upper- and lower-case
41
ASCII letters, and case matters. In this range, case is distinguished
42
both for input and for output values.
44
For radices 63 and 64, the characters '+' (plus) and '/' (forward
45
solidus) are also used. These are derived from the MIME base64
46
encoding scheme. The overall encoding is not the same as base64,
47
because the ASCII digits are used for the bottom of the range, and the
48
letters are shifted upward; however, the output will consist of the
51
This input and output behaviour is inherited from the MPI library used
52
by B<basecvt>, and so is not configurable at runtime.
56
dec2hex(1), hex2dec(1)
60
Michael J. Fromberger <sting@linguist.dartmouth.edu>
61
Thayer School of Engineering, Hanover, New Hampshire, USA
63
$Date: 2000/07/14 00:44:31 $