summaryrefslogtreecommitdiffstats
path: root/usr.bin/bc/bc.1
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2014-05-07 08:06:54 +0000
committerdelphij <delphij@FreeBSD.org>2014-05-07 08:06:54 +0000
commitebef83dbd2b82b4ddf471e1d2b423eef86ccf414 (patch)
tree10b2f68e28cd9e992a4ec257c552c27e4588d64c /usr.bin/bc/bc.1
parentd6c003e92088f30bee1dd2cb9013d5686ad0de3d (diff)
downloadFreeBSD-src-ebef83dbd2b82b4ddf471e1d2b423eef86ccf414.zip
FreeBSD-src-ebef83dbd2b82b4ddf471e1d2b423eef86ccf414.tar.gz
MFC r264573+264608+264609:
Sync with OpenBSD.
Diffstat (limited to 'usr.bin/bc/bc.1')
-rw-r--r--usr.bin/bc/bc.131
1 files changed, 22 insertions, 9 deletions
diff --git a/usr.bin/bc/bc.1 b/usr.bin/bc/bc.1
index 0592acd..2d539ee 100644
--- a/usr.bin/bc/bc.1
+++ b/usr.bin/bc/bc.1
@@ -1,5 +1,5 @@
.\" $FreeBSD$
-.\" $OpenBSD: bc.1,v 1.25 2010/01/02 19:48:56 schwarze Exp $
+.\" $OpenBSD: bc.1,v 1.30 2014/01/14 07:42:42 jmc Exp $
.\"
.\" Copyright (C) Caldera International Inc. 2001-2002.
.\" All rights reserved.
@@ -35,7 +35,7 @@
.\"
.\" @(#)bc.1 6.8 (Berkeley) 8/8/91
.\"
-.Dd December 6, 2013
+.Dd April 16, 2014
.Dt BC 1
.Os
.Sh NAME
@@ -140,8 +140,7 @@ The following arithmetic and logical operators can be used.
The semantics of the operators is the same as in the C language.
They are listed in order of decreasing precedence.
Operators in the same group have the same precedence.
-.Bl -column -offset indent "= += \-= *= /= %= ^=" "Associativity" \
-"multiply, divide, modulus"
+.Bl -column "= += \-= *= /= %= ^=" "Associativity" "multiply, divide, modulus" -offset indent
.It Sy "Operator" Ta Sy "Associativity" Ta Sy "Description"
.It "++ \-\-" Ta "none" Ta "increment, decrement"
.It "\-" Ta "none" Ta "unary minus"
@@ -160,7 +159,7 @@ Note the following:
.It
The relational operators may appear in any expression.
The
-.St -p1003.2
+.St -p1003.1-2008
standard only allows them in the conditional expression of an
.Sq if ,
.Sq while
@@ -342,6 +341,22 @@ $ bc -l -e 'scale = 500; 2 * a(2^10000)' -e quit
.Ed
.Pp
prints an approximation of pi.
+.Sh COMMAND LINE EDITING
+.Nm
+supports interactive command line editing, via the
+.Xr editline 3
+library.
+It is enabled by default if input is from a tty.
+Previous lines can be recalled and edited with the arrow keys,
+and other GNU Emacs-style editing keys may be used as well.
+.Pp
+The
+.Xr editline 3
+library is configured with a
+.Pa .editrc
+file \- refer to
+.Xr editrc 5
+for more information.
.Sh FILES
.Bl -tag -width /usr/share/misc/bc.library -compact
.It Pa /usr/share/misc/bc.library
@@ -359,9 +374,6 @@ options are no-ops for compatibility with some other implementations of
and their use is discouraged.
.Sh SEE ALSO
.Xr dc 1
-.Pp
-"BC \- An Arbitrary Precision Desk-Calculator Language",
-.Pa /usr/share/doc/usd/06.bc/ .
.Sh STANDARDS
The
.Nm
@@ -370,7 +382,8 @@ utility is compliant with the
specification.
.Pp
The flags
-.Op Fl ce
+.Op Fl ce ,
+as well as the parts noted above,
are extensions to that specification.
.Sh HISTORY
The
OpenPOWER on IntegriCloud