Print this page
11622 clean up rarer mandoc lint warnings
@@ -46,11 +46,10 @@
.\"
.TH BC 1 "Aug 29, 2003"
.SH NAME
bc \- arbitrary precision arithmetic language
.SH SYNOPSIS
-.LP
.nf
\fB/usr/bin/bc\fR [\fB-c\fR] [\fB-l\fR] [\fIfile\fR]...
.fi
.LP
@@ -57,23 +56,19 @@
.nf
\fB/usr/xpg6/bin/bc\fR [\fB-c\fR] [\fB-l\fR] [\fIfile\fR]...
.fi
.SH DESCRIPTION
-.sp
-.LP
The \fBbc\fR utility implements an arbitrary precision calculator. It takes
input from any files given, then reads from the standard input. If the standard
input and standard output to \fBbc\fR are attached to a terminal, the
invocation of \fBbc\fR is \fIinteractive\fR, causing behavioral constraints
described in the following sections. \fBbc\fR processes a language that
resembles C and is a preprocessor for the desk calculator program \fBdc\fR,
which it invokes automatically unless the \fB-c\fR option is specified. In this
case the \fBdc\fR input is sent to the standard output instead.
.SH USAGE
-.sp
-.LP
The syntax for \fBbc\fR programs is as follows:
.sp
.ne 2
.na
\fB\fIL\fR\fR
@@ -100,15 +95,12 @@
.RS 5n
Means a statement.
.RE
.SS "Comments"
-.sp
-.LP
Enclosed in \fB/*\fR and \fB*/\fR.
.SS "Names (Operands)"
-.br
.in +2
Simple variables: \fIL\fR.
.in -2
.br
.in +2
@@ -118,12 +110,10 @@
.in +2
The words \fBibase\fR, \fBobase\fR (limited to \fBBC_BASE_MAX\fR), and
\fBscale\fR (limited to \fBBC_SCALE_MAX\fR).
.in -2
.SS "Other Operands"
-.sp
-.LP
Arbitrarily long numbers with optional sign and decimal point. Strings of fewer
than \fBBC_STRING_MAX\fR characters, between double quotes ("). \fB(\fR \fIE\fR
\fB)\fR
.sp
.ne 2
@@ -160,11 +150,10 @@
.RS 21n
.RE
.SS "Operators"
-.sp
.ne 2
.na
\fB\fB+ \(mi * / % ^\fR\fR
.ad
.sp .6
@@ -201,11 +190,10 @@
.RS 4n
.RE
.SS "Statements"
-.br
.in +2
\fIE\fR
.in -2
.br
.in +2
@@ -237,11 +225,10 @@
.in -2
.sp
.LP
\&.string
.SS "Function Definitions"
-.br
.in +2
\fBdefine\fR \fIL\fR \fB(\fR \fIL\fR \fB,\fR.\|.\|.\|\fB,\fR \fIL\fR \fB) {\fR
.in -2
.br
.in +2
@@ -258,11 +245,10 @@
.br
.in +2
\fB}\fR
.in -2
.SS "Functions in \fB-l\fR Math Library"
-.sp
.ne 2
.na
\fB\fBs(\fR\fIx\fR\fB)\fR\fR
.ad
.RS 10n
@@ -330,12 +316,10 @@
simultaneously. All variables are global to the program. \fBauto\fR variables
are stacked during function calls. When using arrays as function arguments or
defining them as automatic variables, empty square brackets must follow the
array name.
.SH OPTIONS
-.sp
-.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fB-c\fR\fR
@@ -344,11 +328,10 @@
Compiles only. The output is \fBdc\fR commands that are sent to the standard
output.
.RE
.SS "/usr/bin/bc"
-.sp
.ne 2
.na
\fB\fB-l\fR\fR
.ad
.RS 6n
@@ -355,11 +338,10 @@
Defines the math functions and initializes \fBscale\fR to \fB20\fR, instead of
the default zero.
.RE
.SS "/usr/xpg6/bin/bc"
-.sp
.ne 2
.na
\fB\fB-l\fR\fR
.ad
.RS 6n
@@ -366,12 +348,10 @@
Defines the math functions and initializes \fBscale\fR to \fB20\fR, instead of
the default zero. All math results have the scale of \fB20\fR.
.RE
.SH OPERANDS
-.sp
-.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fIfile\fR\fR
@@ -380,11 +360,10 @@
A pathname of a text file containing \fBbc\fR program statements. After all
cases of \fIfile\fR have been read, \fBbc\fR reads the standard input.
.RE
.SH EXAMPLES
-.LP
\fBExample 1 \fRSetting the precision of a variable
.sp
.LP
In the shell, the following assigns an approximation of the first ten digits of
\fBn\fR to the variable \fIx\fR:
@@ -450,18 +429,14 @@
.fi
.in -2
.sp
.SH ENVIRONMENT VARIABLES
-.sp
-.LP
See \fBenviron\fR(5) for descriptions of the following environment variables
that affect the execution of \fBbc\fR: \fBLANG\fR, \fBLC_ALL\fR,
\fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
.SH EXIT STATUS
-.sp
-.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
@@ -478,11 +453,10 @@
.RS 15n
An error occurred.
.RE
.SH FILES
-.sp
.ne 2
.na
\fB\fB/usr/lib/lib.b\fR\fR
.ad
.RS 25n
@@ -497,12 +471,10 @@
.RS 25n
to define BC_ parameters
.RE
.SH ATTRIBUTES
-.sp
-.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
@@ -513,17 +485,13 @@
_
Interface Stability Standard
.TE
.SH SEE ALSO
-.sp
-.LP
\fBdc\fR(1), \fBawk\fR(1), \fBattributes\fR(5), \fBenviron\fR(5),
\fBstandards\fR(5)
.SH NOTES
-.sp
-.LP
The \fBbc\fR command does not recognize the logical operators \fB&&\fR and
\fB|\||\fR.
.sp
.LP
The \fBfor\fR statement must have all three expressions (\fIE\fR's).