.TH conv "" "" Command
.PC "Numeric base converter"
\fBconv\fR [\fInumber\^\fR]
.PP
.HS
If no \fInumber\fR is given, reads one number per line from stdin.
.HE
.B conv
converts
.I number
to hexadecimal, decimal, octal, binary, and ASCII characters,
and prints the results on the standard output.
If no
.I number
is given,
.B conv
reads one number per line
from the standard input until you type the end-of-file
character \fB<ctrl-D>\fR.
.PP
.I number
may be in hexadecimal, decimal, octal, binary, or character
format, as shown below.
Each example represents the decimal number 97.
.DS
.ta 0.5i 1.5i
	\fIBase	Representation\fR
	\fRhexadecimal	\fB0x61\fR
	\fRhexadecimal	\fB#61\fR
	\fRdecimal	\fB97\fR
	\fRoctal	\fB0141\fR
	\fRbinary	\fB$1100001\fR
	\fRcharacter	\fB`a'\fR
.DE
.PP
.B conv
represents an ASCII control character in its output by
preceding the character by a carat `^'.
For example, it prints
.B "<ctrl-X>"
as `^X'.
.B conv
prints \*(QLbad digit\*(QR if anything is wrong with the input.
.SH "See Also"
.Xr "bc," bc
.Xr "commands," commands
.Xr "conv," conv
.Xr "dd," dd
.Xr "od," od
.Xr "units" units
.SH Notes
.B conv
represents the input
.I number
internally as a
.B long
integer.
If
.I number
does not fit in a
.BR long ,
.B conv
silently truncates it.
