version 1.17, 2004/08/25 21:59:59 |
version 1.18, 2004/10/19 07:36:51 |
|
|
.Sh SYNOPSIS |
.Sh SYNOPSIS |
.Nm bc |
.Nm bc |
.Op Fl cl |
.Op Fl cl |
|
.Op Fl e Ar expression |
.Op Ar file ... |
.Op Ar file ... |
.Sh DESCRIPTION |
.Sh DESCRIPTION |
.Nm |
.Nm |
is an interactive processor for a language which resembles |
is an interactive processor for a language which resembles |
C but provides unlimited precision arithmetic. |
C but provides unlimited precision arithmetic. |
It takes input from any files given, then reads |
It takes input from any expressions on the command line and |
the standard input. |
any files given, then reads the standard input. |
.Pp |
.Pp |
Options available: |
Options available: |
.Bl -tag -width Ds |
.Bl -tag -width Ds |
|
|
instead of being interpreted by a running |
instead of being interpreted by a running |
.Xr dc 1 |
.Xr dc 1 |
process. |
process. |
|
.It Fl e Ar expression |
|
Evaluate |
|
.Ar expression . |
|
If multiple |
|
.Fl e |
|
options are specified, they are processed in the order given, |
|
separated by newlines. |
.It Fl l |
.It Fl l |
Allow specification |
Allow specification of an arbitrary precision math library. |
of an arbitrary precision math library. |
The definitions in the library are available to command line |
|
expressions. |
.El |
.El |
.Pp |
.Pp |
The syntax for |
The syntax for |
|
|
.Pp |
.Pp |
prints approximate values of the exponential function of |
prints approximate values of the exponential function of |
the first ten integers. |
the first ten integers. |
|
.Pp |
|
.Bd -literal -offset indent |
|
$ bc -l -e 'scale = 500; 2 * a(2^10000)' -e quit |
|
.Ed |
|
.Pp |
|
prints an approximation of pi. |
.Sh FILES |
.Sh FILES |
.Bl -tag -width /usr/share/misc/bc.library -compact |
.Bl -tag -width /usr/share/misc/bc.library -compact |
.It Pa /usr/share/misc/bc.library |
.It Pa /usr/share/misc/bc.library |