aboutsummaryrefslogtreecommitdiff
path: root/manuals
diff options
context:
space:
mode:
Diffstat (limited to 'manuals')
-rw-r--r--manuals/bc/A.174
-rw-r--r--manuals/bc/A.1.md58
-rw-r--r--manuals/bc/E.168
-rw-r--r--manuals/bc/E.1.md52
-rw-r--r--manuals/bc/EH.168
-rw-r--r--manuals/bc/EH.1.md52
-rw-r--r--manuals/bc/EHN.168
-rw-r--r--manuals/bc/EHN.1.md52
-rw-r--r--manuals/bc/EN.168
-rw-r--r--manuals/bc/EN.1.md52
-rw-r--r--manuals/bc/H.174
-rw-r--r--manuals/bc/H.1.md58
-rw-r--r--manuals/bc/HN.174
-rw-r--r--manuals/bc/HN.1.md58
-rw-r--r--manuals/bc/N.174
-rw-r--r--manuals/bc/N.1.md58
-rw-r--r--manuals/bcl.32
-rw-r--r--manuals/dc/A.126
-rw-r--r--manuals/dc/A.1.md18
-rw-r--r--manuals/dc/E.126
-rw-r--r--manuals/dc/E.1.md18
-rw-r--r--manuals/dc/EH.126
-rw-r--r--manuals/dc/EH.1.md18
-rw-r--r--manuals/dc/EHN.126
-rw-r--r--manuals/dc/EHN.1.md18
-rw-r--r--manuals/dc/EN.126
-rw-r--r--manuals/dc/EN.1.md18
-rw-r--r--manuals/dc/H.126
-rw-r--r--manuals/dc/H.1.md18
-rw-r--r--manuals/dc/HN.126
-rw-r--r--manuals/dc/HN.1.md18
-rw-r--r--manuals/dc/N.126
-rw-r--r--manuals/dc/N.1.md18
33 files changed, 1113 insertions, 249 deletions
diff --git a/manuals/bc/A.1 b/manuals/bc/A.1
index 9e612f680132..e8b8bd0892a8 100644
--- a/manuals/bc/A.1
+++ b/manuals/bc/A.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "BC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -711,6 +711,14 @@ This is a \f[B]non-portable extension\f[R].
\f[B]abs(E)\f[R]: The absolute value of \f[B]E\f[R].
This is a \f[B]non-portable extension\f[R].
.IP " 9." 4
+\f[B]is_number(E)\f[R]: \f[B]1\f[R] if the given argument is a number,
+\f[B]0\f[R] if it is a string.
+This is a \f[B]non-portable extension\f[R].
+.IP "10." 4
+\f[B]is_string(E)\f[R]: \f[B]1\f[R] if the given argument is a string,
+\f[B]0\f[R] if it is a number.
+This is a \f[B]non-portable extension\f[R].
+.IP "11." 4
\f[B]modexp(E, E, E)\f[R]: Modular exponentiation, where the first
expression is the base, the second is the exponent, and the third is the
modulus.
@@ -718,7 +726,7 @@ All three values must be integers.
The second argument must be non-negative.
The third argument must be non-zero.
This is a \f[B]non-portable extension\f[R].
-.IP "10." 4
+.IP "12." 4
\f[B]divmod(E, E, I[])\f[R]: Division and modulus in one operation.
This is for optimization.
The first expression is the dividend, and the second is the divisor,
@@ -726,13 +734,19 @@ which must be non-zero.
The return value is the quotient, and the modulus is stored in index
\f[B]0\f[R] of the provided array (the last argument).
This is a \f[B]non-portable extension\f[R].
-.IP "11." 4
+.IP "13." 4
\f[B]asciify(E)\f[R]: If \f[B]E\f[R] is a string, returns a string that
is the first letter of its argument.
If it is a number, calculates the number mod \f[B]256\f[R] and returns
that number as a one-character string.
This is a \f[B]non-portable extension\f[R].
-.IP "12." 4
+.IP "14." 4
+\f[B]asciify(I[])\f[R]: A string that is made up of the characters that
+would result from running \f[B]asciify(E)\f[R] on each element of the
+array identified by the argument.
+This allows creating multi-character strings and storing them.
+This is a \f[B]non-portable extension\f[R].
+.IP "15." 4
\f[B]I()\f[R], \f[B]I(E)\f[R], \f[B]I(E, E)\f[R], and so on, where
\f[B]I\f[R] is an identifier for a non-\f[B]void\f[R] function (see the
\f[I]Void Functions\f[R] subsection of the \f[B]FUNCTIONS\f[R] section).
@@ -741,44 +755,44 @@ The \f[B]E\f[R] argument(s) may also be arrays of the form
(see the \f[I]Array References\f[R] subsection of the
\f[B]FUNCTIONS\f[R] section) if the corresponding parameter in the
function definition is an array reference.
-.IP "13." 4
+.IP "16." 4
\f[B]read()\f[R]: Reads a line from \f[B]stdin\f[R] and uses that as an
expression.
The result of that expression is the result of the \f[B]read()\f[R]
operand.
This is a \f[B]non-portable extension\f[R].
-.IP "14." 4
+.IP "17." 4
\f[B]maxibase()\f[R]: The max allowable \f[B]ibase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "15." 4
+.IP "18." 4
\f[B]maxobase()\f[R]: The max allowable \f[B]obase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "16." 4
+.IP "19." 4
\f[B]maxscale()\f[R]: The max allowable \f[B]scale\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "17." 4
+.IP "20." 4
\f[B]line_length()\f[R]: The line length set with
\f[B]BC_LINE_LENGTH\f[R] (see the \f[B]ENVIRONMENT VARIABLES\f[R]
section).
This is a \f[B]non-portable extension\f[R].
-.IP "18." 4
+.IP "21." 4
\f[B]global_stacks()\f[R]: \f[B]0\f[R] if global stacks are not enabled
with the \f[B]-g\f[R] or \f[B]--global-stacks\f[R] options, non-zero
otherwise.
See the \f[B]OPTIONS\f[R] section.
This is a \f[B]non-portable extension\f[R].
-.IP "19." 4
+.IP "22." 4
\f[B]leading_zero()\f[R]: \f[B]0\f[R] if leading zeroes are not enabled
with the \f[B]-z\f[R] or \f[B]\[en]leading-zeroes\f[R] options, non-zero
otherwise.
See the \f[B]OPTIONS\f[R] section.
This is a \f[B]non-portable extension\f[R].
-.IP "20." 4
+.IP "23." 4
\f[B]rand()\f[R]: A pseudo-random integer between \f[B]0\f[R]
(inclusive) and \f[B]BC_RAND_MAX\f[R] (inclusive).
Using this operand will change the value of \f[B]seed\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "21." 4
+.IP "24." 4
\f[B]irand(E)\f[R]: A pseudo-random integer between \f[B]0\f[R]
(inclusive) and the value of \f[B]E\f[R] (exclusive).
If \f[B]E\f[R] is negative or is a non-integer (\f[B]E\f[R]\[cq]s
@@ -796,7 +810,7 @@ value of \f[B]E\f[R] is \f[B]0\f[R] or \f[B]1\f[R].
In that case, \f[B]0\f[R] is returned, and \f[B]seed\f[R] is
\f[I]not\f[R] changed.
This is a \f[B]non-portable extension\f[R].
-.IP "22." 4
+.IP "25." 4
\f[B]maxrand()\f[R]: The max integer returned by \f[B]rand()\f[R].
This is a \f[B]non-portable extension\f[R].
.PP
@@ -1247,6 +1261,25 @@ The \f[B]if\f[R] \f[B]else\f[R] statement does the same thing as in C.
The \f[B]quit\f[R] statement causes bc(1) to quit, even if it is on a
branch that will not be executed (it is a compile-time command).
.PP
+\f[B]Warning\f[R]: The behavior of this bc(1) on \f[B]quit\f[R] is
+slightly different from other bc(1) implementations.
+Other bc(1) implementations will exit as soon as they finish parsing the
+line that a \f[B]quit\f[R] command is on.
+This bc(1) will execute any completed and executable statements that
+occur before the \f[B]quit\f[R] statement before exiting.
+.PP
+In other words, for the bc(1) code below:
+.IP
+.nf
+\f[C]
+for (i = 0; i < 3; ++i) i; quit
+\f[R]
+.fi
+.PP
+Other bc(1) implementations will print nothing, and this bc(1) will
+print \f[B]0\f[R], \f[B]1\f[R], and \f[B]2\f[R] on successive lines
+before exiting.
+.PP
The \f[B]halt\f[R] statement causes bc(1) to quit, if it is executed.
(Unlike \f[B]quit\f[R] if it is on a branch of an \f[B]if\f[R] statement
that is not executed, bc(1) does not quit.)
@@ -2926,6 +2959,12 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
The flags \f[B]-efghiqsvVw\f[R], all long options, and the extensions
noted above are extensions to that specification.
.PP
+In addition, the behavior of the \f[B]quit\f[R] implements an
+interpretation of that specification that is different from all known
+implementations.
+For more information see the \f[B]Statements\f[R] subsection of the
+\f[B]SYNTAX\f[R] section.
+.PP
Note that the specification explicitly says that bc(1) only accepts
numbers that use a period (\f[B].\f[R]) as a radix point, regardless of
the value of \f[B]LC_NUMERIC\f[R].
@@ -2934,8 +2973,11 @@ This bc(1) supports error messages for different locales, and thus, it
supports \f[B]LC_MESSAGES\f[R].
.SH BUGS
.PP
-None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
+the \f[B]quit\f[R] statement.
+.PP
+No other bugs are known.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHORS
.PP
Gavin D.
diff --git a/manuals/bc/A.1.md b/manuals/bc/A.1.md
index f4d0ad892a2b..754ceda1adb6 100644
--- a/manuals/bc/A.1.md
+++ b/manuals/bc/A.1.md
@@ -558,46 +558,54 @@ The following are valid operands in bc(1):
7. **scale(E)**: The *scale* of **E**.
8. **abs(E)**: The absolute value of **E**. This is a **non-portable
extension**.
-9. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
+9. **is_number(E)**: **1** if the given argument is a number, **0** if it is a
+ string. This is a **non-portable extension**.
+10. **is_string(E)**: **1** if the given argument is a string, **0** if it is a
+ number. This is a **non-portable extension**.
+11. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
the base, the second is the exponent, and the third is the modulus. All
three values must be integers. The second argument must be non-negative. The
third argument must be non-zero. This is a **non-portable extension**.
-10. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
+11. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
optimization. The first expression is the dividend, and the second is the
divisor, which must be non-zero. The return value is the quotient, and the
modulus is stored in index **0** of the provided array (the last argument).
This is a **non-portable extension**.
-11. **asciify(E)**: If **E** is a string, returns a string that is the first
+12. **asciify(E)**: If **E** is a string, returns a string that is the first
letter of its argument. If it is a number, calculates the number mod **256**
and returns that number as a one-character string. This is a **non-portable
extension**.
-12. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
+13. **asciify(I[])**: A string that is made up of the characters that would
+ result from running **asciify(E)** on each element of the array identified
+ by the argument. This allows creating multi-character strings and storing
+ them. This is a **non-portable extension**.
+14. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
a non-**void** function (see the *Void Functions* subsection of the
**FUNCTIONS** section). The **E** argument(s) may also be arrays of the form
**I[]**, which will automatically be turned into array references (see the
*Array References* subsection of the **FUNCTIONS** section) if the
corresponding parameter in the function definition is an array reference.
-13. **read()**: Reads a line from **stdin** and uses that as an expression. The
+15. **read()**: Reads a line from **stdin** and uses that as an expression. The
result of that expression is the result of the **read()** operand. This is a
**non-portable extension**.
-14. **maxibase()**: The max allowable **ibase**. This is a **non-portable
+16. **maxibase()**: The max allowable **ibase**. This is a **non-portable
extension**.
-15. **maxobase()**: The max allowable **obase**. This is a **non-portable
+17. **maxobase()**: The max allowable **obase**. This is a **non-portable
extension**.
-16. **maxscale()**: The max allowable **scale**. This is a **non-portable
+18. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
-17. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
+19. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
**ENVIRONMENT VARIABLES** section). This is a **non-portable extension**.
-18. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
+20. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
or **-\-global-stacks** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
-19. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
+21. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
or **--leading-zeroes** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
-20. **rand()**: A pseudo-random integer between **0** (inclusive) and
+22. **rand()**: A pseudo-random integer between **0** (inclusive) and
**BC_RAND_MAX** (inclusive). Using this operand will change the value of
**seed**. This is a **non-portable extension**.
-21. **irand(E)**: A pseudo-random integer between **0** (inclusive) and the
+23. **irand(E)**: A pseudo-random integer between **0** (inclusive) and the
value of **E** (exclusive). If **E** is negative or is a non-integer
(**E**'s *scale* is not **0**), an error is raised, and bc(1) resets (see
the **RESET** section) while **seed** remains unchanged. If **E** is larger
@@ -608,7 +616,7 @@ The following are valid operands in bc(1):
change the value of **seed**, unless the value of **E** is **0** or **1**.
In that case, **0** is returned, and **seed** is *not* changed. This is a
**non-portable extension**.
-22. **maxrand()**: The max integer returned by **rand()**. This is a
+24. **maxrand()**: The max integer returned by **rand()**. This is a
**non-portable extension**.
The integers generated by **rand()** and **irand(E)** are guaranteed to be as
@@ -976,6 +984,19 @@ The **if** **else** statement does the same thing as in C.
The **quit** statement causes bc(1) to quit, even if it is on a branch that will
not be executed (it is a compile-time command).
+**Warning**: The behavior of this bc(1) on **quit** is slightly different from
+other bc(1) implementations. Other bc(1) implementations will exit as soon as
+they finish parsing the line that a **quit** command is on. This bc(1) will
+execute any completed and executable statements that occur before the **quit**
+statement before exiting.
+
+In other words, for the bc(1) code below:
+
+ for (i = 0; i < 3; ++i) i; quit
+
+Other bc(1) implementations will print nothing, and this bc(1) will print **0**,
+**1**, and **2** on successive lines before exiting.
+
The **halt** statement causes bc(1) to quit, if it is executed. (Unlike **quit**
if it is on a branch of an **if** statement that is not executed, bc(1) does not
quit.)
@@ -2461,6 +2482,10 @@ at https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . The
flags **-efghiqsvVw**, all long options, and the extensions noted above are
extensions to that specification.
+In addition, the behavior of the **quit** implements an interpretation of that
+specification that is different from all known implementations. For more
+information see the **Statements** subsection of the **SYNTAX** section.
+
Note that the specification explicitly says that bc(1) only accepts numbers that
use a period (**.**) as a radix point, regardless of the value of
**LC_NUMERIC**.
@@ -2470,7 +2495,10 @@ This bc(1) supports error messages for different locales, and thus, it supports
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
+statement.
+
+No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHORS
diff --git a/manuals/bc/E.1 b/manuals/bc/E.1
index d5e81268f801..f9e8c8b2d02f 100644
--- a/manuals/bc/E.1
+++ b/manuals/bc/E.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "BC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -633,6 +633,14 @@ This is a \f[B]non-portable extension\f[R].
\f[B]abs(E)\f[R]: The absolute value of \f[B]E\f[R].
This is a \f[B]non-portable extension\f[R].
.IP " 9." 4
+\f[B]is_number(E)\f[R]: \f[B]1\f[R] if the given argument is a number,
+\f[B]0\f[R] if it is a string.
+This is a \f[B]non-portable extension\f[R].
+.IP "10." 4
+\f[B]is_string(E)\f[R]: \f[B]1\f[R] if the given argument is a string,
+\f[B]0\f[R] if it is a number.
+This is a \f[B]non-portable extension\f[R].
+.IP "11." 4
\f[B]modexp(E, E, E)\f[R]: Modular exponentiation, where the first
expression is the base, the second is the exponent, and the third is the
modulus.
@@ -640,7 +648,7 @@ All three values must be integers.
The second argument must be non-negative.
The third argument must be non-zero.
This is a \f[B]non-portable extension\f[R].
-.IP "10." 4
+.IP "12." 4
\f[B]divmod(E, E, I[])\f[R]: Division and modulus in one operation.
This is for optimization.
The first expression is the dividend, and the second is the divisor,
@@ -648,13 +656,19 @@ which must be non-zero.
The return value is the quotient, and the modulus is stored in index
\f[B]0\f[R] of the provided array (the last argument).
This is a \f[B]non-portable extension\f[R].
-.IP "11." 4
+.IP "13." 4
\f[B]asciify(E)\f[R]: If \f[B]E\f[R] is a string, returns a string that
is the first letter of its argument.
If it is a number, calculates the number mod \f[B]256\f[R] and returns
that number as a one-character string.
This is a \f[B]non-portable extension\f[R].
-.IP "12." 4
+.IP "14." 4
+\f[B]asciify(I[])\f[R]: A string that is made up of the characters that
+would result from running \f[B]asciify(E)\f[R] on each element of the
+array identified by the argument.
+This allows creating multi-character strings and storing them.
+This is a \f[B]non-portable extension\f[R].
+.IP "15." 4
\f[B]I()\f[R], \f[B]I(E)\f[R], \f[B]I(E, E)\f[R], and so on, where
\f[B]I\f[R] is an identifier for a non-\f[B]void\f[R] function (see the
\f[I]Void Functions\f[R] subsection of the \f[B]FUNCTIONS\f[R] section).
@@ -663,33 +677,33 @@ The \f[B]E\f[R] argument(s) may also be arrays of the form
(see the \f[I]Array References\f[R] subsection of the
\f[B]FUNCTIONS\f[R] section) if the corresponding parameter in the
function definition is an array reference.
-.IP "13." 4
+.IP "16." 4
\f[B]read()\f[R]: Reads a line from \f[B]stdin\f[R] and uses that as an
expression.
The result of that expression is the result of the \f[B]read()\f[R]
operand.
This is a \f[B]non-portable extension\f[R].
-.IP "14." 4
+.IP "17." 4
\f[B]maxibase()\f[R]: The max allowable \f[B]ibase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "15." 4
+.IP "18." 4
\f[B]maxobase()\f[R]: The max allowable \f[B]obase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "16." 4
+.IP "19." 4
\f[B]maxscale()\f[R]: The max allowable \f[B]scale\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "17." 4
+.IP "20." 4
\f[B]line_length()\f[R]: The line length set with
\f[B]BC_LINE_LENGTH\f[R] (see the \f[B]ENVIRONMENT VARIABLES\f[R]
section).
This is a \f[B]non-portable extension\f[R].
-.IP "18." 4
+.IP "21." 4
\f[B]global_stacks()\f[R]: \f[B]0\f[R] if global stacks are not enabled
with the \f[B]-g\f[R] or \f[B]--global-stacks\f[R] options, non-zero
otherwise.
See the \f[B]OPTIONS\f[R] section.
This is a \f[B]non-portable extension\f[R].
-.IP "19." 4
+.IP "22." 4
\f[B]leading_zero()\f[R]: \f[B]0\f[R] if leading zeroes are not enabled
with the \f[B]-z\f[R] or \f[B]\[en]leading-zeroes\f[R] options, non-zero
otherwise.
@@ -1026,6 +1040,25 @@ The \f[B]if\f[R] \f[B]else\f[R] statement does the same thing as in C.
The \f[B]quit\f[R] statement causes bc(1) to quit, even if it is on a
branch that will not be executed (it is a compile-time command).
.PP
+\f[B]Warning\f[R]: The behavior of this bc(1) on \f[B]quit\f[R] is
+slightly different from other bc(1) implementations.
+Other bc(1) implementations will exit as soon as they finish parsing the
+line that a \f[B]quit\f[R] command is on.
+This bc(1) will execute any completed and executable statements that
+occur before the \f[B]quit\f[R] statement before exiting.
+.PP
+In other words, for the bc(1) code below:
+.IP
+.nf
+\f[C]
+for (i = 0; i < 3; ++i) i; quit
+\f[R]
+.fi
+.PP
+Other bc(1) implementations will print nothing, and this bc(1) will
+print \f[B]0\f[R], \f[B]1\f[R], and \f[B]2\f[R] on successive lines
+before exiting.
+.PP
The \f[B]halt\f[R] statement causes bc(1) to quit, if it is executed.
(Unlike \f[B]quit\f[R] if it is on a branch of an \f[B]if\f[R] statement
that is not executed, bc(1) does not quit.)
@@ -1759,6 +1792,12 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
The flags \f[B]-efghiqsvVw\f[R], all long options, and the extensions
noted above are extensions to that specification.
.PP
+In addition, the behavior of the \f[B]quit\f[R] implements an
+interpretation of that specification that is different from all known
+implementations.
+For more information see the \f[B]Statements\f[R] subsection of the
+\f[B]SYNTAX\f[R] section.
+.PP
Note that the specification explicitly says that bc(1) only accepts
numbers that use a period (\f[B].\f[R]) as a radix point, regardless of
the value of \f[B]LC_NUMERIC\f[R].
@@ -1767,8 +1806,11 @@ This bc(1) supports error messages for different locales, and thus, it
supports \f[B]LC_MESSAGES\f[R].
.SH BUGS
.PP
-None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
+the \f[B]quit\f[R] statement.
+.PP
+No other bugs are known.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHORS
.PP
Gavin D.
diff --git a/manuals/bc/E.1.md b/manuals/bc/E.1.md
index 85db83b1d2d8..cf52f5a2035e 100644
--- a/manuals/bc/E.1.md
+++ b/manuals/bc/E.1.md
@@ -504,40 +504,48 @@ The following are valid operands in bc(1):
7. **scale(E)**: The *scale* of **E**.
8. **abs(E)**: The absolute value of **E**. This is a **non-portable
extension**.
-9. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
+9. **is_number(E)**: **1** if the given argument is a number, **0** if it is a
+ string. This is a **non-portable extension**.
+10. **is_string(E)**: **1** if the given argument is a string, **0** if it is a
+ number. This is a **non-portable extension**.
+11. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
the base, the second is the exponent, and the third is the modulus. All
three values must be integers. The second argument must be non-negative. The
third argument must be non-zero. This is a **non-portable extension**.
-10. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
+11. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
optimization. The first expression is the dividend, and the second is the
divisor, which must be non-zero. The return value is the quotient, and the
modulus is stored in index **0** of the provided array (the last argument).
This is a **non-portable extension**.
-11. **asciify(E)**: If **E** is a string, returns a string that is the first
+12. **asciify(E)**: If **E** is a string, returns a string that is the first
letter of its argument. If it is a number, calculates the number mod **256**
and returns that number as a one-character string. This is a **non-portable
extension**.
-12. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
+13. **asciify(I[])**: A string that is made up of the characters that would
+ result from running **asciify(E)** on each element of the array identified
+ by the argument. This allows creating multi-character strings and storing
+ them. This is a **non-portable extension**.
+14. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
a non-**void** function (see the *Void Functions* subsection of the
**FUNCTIONS** section). The **E** argument(s) may also be arrays of the form
**I[]**, which will automatically be turned into array references (see the
*Array References* subsection of the **FUNCTIONS** section) if the
corresponding parameter in the function definition is an array reference.
-13. **read()**: Reads a line from **stdin** and uses that as an expression. The
+15. **read()**: Reads a line from **stdin** and uses that as an expression. The
result of that expression is the result of the **read()** operand. This is a
**non-portable extension**.
-14. **maxibase()**: The max allowable **ibase**. This is a **non-portable
+16. **maxibase()**: The max allowable **ibase**. This is a **non-portable
extension**.
-15. **maxobase()**: The max allowable **obase**. This is a **non-portable
+17. **maxobase()**: The max allowable **obase**. This is a **non-portable
extension**.
-16. **maxscale()**: The max allowable **scale**. This is a **non-portable
+18. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
-17. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
+19. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
**ENVIRONMENT VARIABLES** section). This is a **non-portable extension**.
-18. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
+20. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
or **-\-global-stacks** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
-19. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
+21. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
or **--leading-zeroes** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
@@ -811,6 +819,19 @@ The **if** **else** statement does the same thing as in C.
The **quit** statement causes bc(1) to quit, even if it is on a branch that will
not be executed (it is a compile-time command).
+**Warning**: The behavior of this bc(1) on **quit** is slightly different from
+other bc(1) implementations. Other bc(1) implementations will exit as soon as
+they finish parsing the line that a **quit** command is on. This bc(1) will
+execute any completed and executable statements that occur before the **quit**
+statement before exiting.
+
+In other words, for the bc(1) code below:
+
+ for (i = 0; i < 3; ++i) i; quit
+
+Other bc(1) implementations will print nothing, and this bc(1) will print **0**,
+**1**, and **2** on successive lines before exiting.
+
The **halt** statement causes bc(1) to quit, if it is executed. (Unlike **quit**
if it is on a branch of an **if** statement that is not executed, bc(1) does not
quit.)
@@ -1469,6 +1490,10 @@ at https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . The
flags **-efghiqsvVw**, all long options, and the extensions noted above are
extensions to that specification.
+In addition, the behavior of the **quit** implements an interpretation of that
+specification that is different from all known implementations. For more
+information see the **Statements** subsection of the **SYNTAX** section.
+
Note that the specification explicitly says that bc(1) only accepts numbers that
use a period (**.**) as a radix point, regardless of the value of
**LC_NUMERIC**.
@@ -1478,7 +1503,10 @@ This bc(1) supports error messages for different locales, and thus, it supports
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
+statement.
+
+No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHORS
diff --git a/manuals/bc/EH.1 b/manuals/bc/EH.1
index f0f2b1274dad..5c556c049f14 100644
--- a/manuals/bc/EH.1
+++ b/manuals/bc/EH.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "BC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -633,6 +633,14 @@ This is a \f[B]non-portable extension\f[R].
\f[B]abs(E)\f[R]: The absolute value of \f[B]E\f[R].
This is a \f[B]non-portable extension\f[R].
.IP " 9." 4
+\f[B]is_number(E)\f[R]: \f[B]1\f[R] if the given argument is a number,
+\f[B]0\f[R] if it is a string.
+This is a \f[B]non-portable extension\f[R].
+.IP "10." 4
+\f[B]is_string(E)\f[R]: \f[B]1\f[R] if the given argument is a string,
+\f[B]0\f[R] if it is a number.
+This is a \f[B]non-portable extension\f[R].
+.IP "11." 4
\f[B]modexp(E, E, E)\f[R]: Modular exponentiation, where the first
expression is the base, the second is the exponent, and the third is the
modulus.
@@ -640,7 +648,7 @@ All three values must be integers.
The second argument must be non-negative.
The third argument must be non-zero.
This is a \f[B]non-portable extension\f[R].
-.IP "10." 4
+.IP "12." 4
\f[B]divmod(E, E, I[])\f[R]: Division and modulus in one operation.
This is for optimization.
The first expression is the dividend, and the second is the divisor,
@@ -648,13 +656,19 @@ which must be non-zero.
The return value is the quotient, and the modulus is stored in index
\f[B]0\f[R] of the provided array (the last argument).
This is a \f[B]non-portable extension\f[R].
-.IP "11." 4
+.IP "13." 4
\f[B]asciify(E)\f[R]: If \f[B]E\f[R] is a string, returns a string that
is the first letter of its argument.
If it is a number, calculates the number mod \f[B]256\f[R] and returns
that number as a one-character string.
This is a \f[B]non-portable extension\f[R].
-.IP "12." 4
+.IP "14." 4
+\f[B]asciify(I[])\f[R]: A string that is made up of the characters that
+would result from running \f[B]asciify(E)\f[R] on each element of the
+array identified by the argument.
+This allows creating multi-character strings and storing them.
+This is a \f[B]non-portable extension\f[R].
+.IP "15." 4
\f[B]I()\f[R], \f[B]I(E)\f[R], \f[B]I(E, E)\f[R], and so on, where
\f[B]I\f[R] is an identifier for a non-\f[B]void\f[R] function (see the
\f[I]Void Functions\f[R] subsection of the \f[B]FUNCTIONS\f[R] section).
@@ -663,33 +677,33 @@ The \f[B]E\f[R] argument(s) may also be arrays of the form
(see the \f[I]Array References\f[R] subsection of the
\f[B]FUNCTIONS\f[R] section) if the corresponding parameter in the
function definition is an array reference.
-.IP "13." 4
+.IP "16." 4
\f[B]read()\f[R]: Reads a line from \f[B]stdin\f[R] and uses that as an
expression.
The result of that expression is the result of the \f[B]read()\f[R]
operand.
This is a \f[B]non-portable extension\f[R].
-.IP "14." 4
+.IP "17." 4
\f[B]maxibase()\f[R]: The max allowable \f[B]ibase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "15." 4
+.IP "18." 4
\f[B]maxobase()\f[R]: The max allowable \f[B]obase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "16." 4
+.IP "19." 4
\f[B]maxscale()\f[R]: The max allowable \f[B]scale\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "17." 4
+.IP "20." 4
\f[B]line_length()\f[R]: The line length set with
\f[B]BC_LINE_LENGTH\f[R] (see the \f[B]ENVIRONMENT VARIABLES\f[R]
section).
This is a \f[B]non-portable extension\f[R].
-.IP "18." 4
+.IP "21." 4
\f[B]global_stacks()\f[R]: \f[B]0\f[R] if global stacks are not enabled
with the \f[B]-g\f[R] or \f[B]--global-stacks\f[R] options, non-zero
otherwise.
See the \f[B]OPTIONS\f[R] section.
This is a \f[B]non-portable extension\f[R].
-.IP "19." 4
+.IP "22." 4
\f[B]leading_zero()\f[R]: \f[B]0\f[R] if leading zeroes are not enabled
with the \f[B]-z\f[R] or \f[B]\[en]leading-zeroes\f[R] options, non-zero
otherwise.
@@ -1026,6 +1040,25 @@ The \f[B]if\f[R] \f[B]else\f[R] statement does the same thing as in C.
The \f[B]quit\f[R] statement causes bc(1) to quit, even if it is on a
branch that will not be executed (it is a compile-time command).
.PP
+\f[B]Warning\f[R]: The behavior of this bc(1) on \f[B]quit\f[R] is
+slightly different from other bc(1) implementations.
+Other bc(1) implementations will exit as soon as they finish parsing the
+line that a \f[B]quit\f[R] command is on.
+This bc(1) will execute any completed and executable statements that
+occur before the \f[B]quit\f[R] statement before exiting.
+.PP
+In other words, for the bc(1) code below:
+.IP
+.nf
+\f[C]
+for (i = 0; i < 3; ++i) i; quit
+\f[R]
+.fi
+.PP
+Other bc(1) implementations will print nothing, and this bc(1) will
+print \f[B]0\f[R], \f[B]1\f[R], and \f[B]2\f[R] on successive lines
+before exiting.
+.PP
The \f[B]halt\f[R] statement causes bc(1) to quit, if it is executed.
(Unlike \f[B]quit\f[R] if it is on a branch of an \f[B]if\f[R] statement
that is not executed, bc(1) does not quit.)
@@ -1730,6 +1763,12 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
The flags \f[B]-efghiqsvVw\f[R], all long options, and the extensions
noted above are extensions to that specification.
.PP
+In addition, the behavior of the \f[B]quit\f[R] implements an
+interpretation of that specification that is different from all known
+implementations.
+For more information see the \f[B]Statements\f[R] subsection of the
+\f[B]SYNTAX\f[R] section.
+.PP
Note that the specification explicitly says that bc(1) only accepts
numbers that use a period (\f[B].\f[R]) as a radix point, regardless of
the value of \f[B]LC_NUMERIC\f[R].
@@ -1738,8 +1777,11 @@ This bc(1) supports error messages for different locales, and thus, it
supports \f[B]LC_MESSAGES\f[R].
.SH BUGS
.PP
-None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
+the \f[B]quit\f[R] statement.
+.PP
+No other bugs are known.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHORS
.PP
Gavin D.
diff --git a/manuals/bc/EH.1.md b/manuals/bc/EH.1.md
index 18c77d569d39..bb905be37f95 100644
--- a/manuals/bc/EH.1.md
+++ b/manuals/bc/EH.1.md
@@ -504,40 +504,48 @@ The following are valid operands in bc(1):
7. **scale(E)**: The *scale* of **E**.
8. **abs(E)**: The absolute value of **E**. This is a **non-portable
extension**.
-9. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
+9. **is_number(E)**: **1** if the given argument is a number, **0** if it is a
+ string. This is a **non-portable extension**.
+10. **is_string(E)**: **1** if the given argument is a string, **0** if it is a
+ number. This is a **non-portable extension**.
+11. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
the base, the second is the exponent, and the third is the modulus. All
three values must be integers. The second argument must be non-negative. The
third argument must be non-zero. This is a **non-portable extension**.
-10. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
+11. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
optimization. The first expression is the dividend, and the second is the
divisor, which must be non-zero. The return value is the quotient, and the
modulus is stored in index **0** of the provided array (the last argument).
This is a **non-portable extension**.
-11. **asciify(E)**: If **E** is a string, returns a string that is the first
+12. **asciify(E)**: If **E** is a string, returns a string that is the first
letter of its argument. If it is a number, calculates the number mod **256**
and returns that number as a one-character string. This is a **non-portable
extension**.
-12. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
+13. **asciify(I[])**: A string that is made up of the characters that would
+ result from running **asciify(E)** on each element of the array identified
+ by the argument. This allows creating multi-character strings and storing
+ them. This is a **non-portable extension**.
+14. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
a non-**void** function (see the *Void Functions* subsection of the
**FUNCTIONS** section). The **E** argument(s) may also be arrays of the form
**I[]**, which will automatically be turned into array references (see the
*Array References* subsection of the **FUNCTIONS** section) if the
corresponding parameter in the function definition is an array reference.
-13. **read()**: Reads a line from **stdin** and uses that as an expression. The
+15. **read()**: Reads a line from **stdin** and uses that as an expression. The
result of that expression is the result of the **read()** operand. This is a
**non-portable extension**.
-14. **maxibase()**: The max allowable **ibase**. This is a **non-portable
+16. **maxibase()**: The max allowable **ibase**. This is a **non-portable
extension**.
-15. **maxobase()**: The max allowable **obase**. This is a **non-portable
+17. **maxobase()**: The max allowable **obase**. This is a **non-portable
extension**.
-16. **maxscale()**: The max allowable **scale**. This is a **non-portable
+18. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
-17. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
+19. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
**ENVIRONMENT VARIABLES** section). This is a **non-portable extension**.
-18. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
+20. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
or **-\-global-stacks** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
-19. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
+21. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
or **--leading-zeroes** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
@@ -811,6 +819,19 @@ The **if** **else** statement does the same thing as in C.
The **quit** statement causes bc(1) to quit, even if it is on a branch that will
not be executed (it is a compile-time command).
+**Warning**: The behavior of this bc(1) on **quit** is slightly different from
+other bc(1) implementations. Other bc(1) implementations will exit as soon as
+they finish parsing the line that a **quit** command is on. This bc(1) will
+execute any completed and executable statements that occur before the **quit**
+statement before exiting.
+
+In other words, for the bc(1) code below:
+
+ for (i = 0; i < 3; ++i) i; quit
+
+Other bc(1) implementations will print nothing, and this bc(1) will print **0**,
+**1**, and **2** on successive lines before exiting.
+
The **halt** statement causes bc(1) to quit, if it is executed. (Unlike **quit**
if it is on a branch of an **if** statement that is not executed, bc(1) does not
quit.)
@@ -1443,6 +1464,10 @@ at https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . The
flags **-efghiqsvVw**, all long options, and the extensions noted above are
extensions to that specification.
+In addition, the behavior of the **quit** implements an interpretation of that
+specification that is different from all known implementations. For more
+information see the **Statements** subsection of the **SYNTAX** section.
+
Note that the specification explicitly says that bc(1) only accepts numbers that
use a period (**.**) as a radix point, regardless of the value of
**LC_NUMERIC**.
@@ -1452,7 +1477,10 @@ This bc(1) supports error messages for different locales, and thus, it supports
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
+statement.
+
+No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHORS
diff --git a/manuals/bc/EHN.1 b/manuals/bc/EHN.1
index 03887eb6ebe4..d5fafaf4d1da 100644
--- a/manuals/bc/EHN.1
+++ b/manuals/bc/EHN.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "BC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -633,6 +633,14 @@ This is a \f[B]non-portable extension\f[R].
\f[B]abs(E)\f[R]: The absolute value of \f[B]E\f[R].
This is a \f[B]non-portable extension\f[R].
.IP " 9." 4
+\f[B]is_number(E)\f[R]: \f[B]1\f[R] if the given argument is a number,
+\f[B]0\f[R] if it is a string.
+This is a \f[B]non-portable extension\f[R].
+.IP "10." 4
+\f[B]is_string(E)\f[R]: \f[B]1\f[R] if the given argument is a string,
+\f[B]0\f[R] if it is a number.
+This is a \f[B]non-portable extension\f[R].
+.IP "11." 4
\f[B]modexp(E, E, E)\f[R]: Modular exponentiation, where the first
expression is the base, the second is the exponent, and the third is the
modulus.
@@ -640,7 +648,7 @@ All three values must be integers.
The second argument must be non-negative.
The third argument must be non-zero.
This is a \f[B]non-portable extension\f[R].
-.IP "10." 4
+.IP "12." 4
\f[B]divmod(E, E, I[])\f[R]: Division and modulus in one operation.
This is for optimization.
The first expression is the dividend, and the second is the divisor,
@@ -648,13 +656,19 @@ which must be non-zero.
The return value is the quotient, and the modulus is stored in index
\f[B]0\f[R] of the provided array (the last argument).
This is a \f[B]non-portable extension\f[R].
-.IP "11." 4
+.IP "13." 4
\f[B]asciify(E)\f[R]: If \f[B]E\f[R] is a string, returns a string that
is the first letter of its argument.
If it is a number, calculates the number mod \f[B]256\f[R] and returns
that number as a one-character string.
This is a \f[B]non-portable extension\f[R].
-.IP "12." 4
+.IP "14." 4
+\f[B]asciify(I[])\f[R]: A string that is made up of the characters that
+would result from running \f[B]asciify(E)\f[R] on each element of the
+array identified by the argument.
+This allows creating multi-character strings and storing them.
+This is a \f[B]non-portable extension\f[R].
+.IP "15." 4
\f[B]I()\f[R], \f[B]I(E)\f[R], \f[B]I(E, E)\f[R], and so on, where
\f[B]I\f[R] is an identifier for a non-\f[B]void\f[R] function (see the
\f[I]Void Functions\f[R] subsection of the \f[B]FUNCTIONS\f[R] section).
@@ -663,33 +677,33 @@ The \f[B]E\f[R] argument(s) may also be arrays of the form
(see the \f[I]Array References\f[R] subsection of the
\f[B]FUNCTIONS\f[R] section) if the corresponding parameter in the
function definition is an array reference.
-.IP "13." 4
+.IP "16." 4
\f[B]read()\f[R]: Reads a line from \f[B]stdin\f[R] and uses that as an
expression.
The result of that expression is the result of the \f[B]read()\f[R]
operand.
This is a \f[B]non-portable extension\f[R].
-.IP "14." 4
+.IP "17." 4
\f[B]maxibase()\f[R]: The max allowable \f[B]ibase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "15." 4
+.IP "18." 4
\f[B]maxobase()\f[R]: The max allowable \f[B]obase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "16." 4
+.IP "19." 4
\f[B]maxscale()\f[R]: The max allowable \f[B]scale\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "17." 4
+.IP "20." 4
\f[B]line_length()\f[R]: The line length set with
\f[B]BC_LINE_LENGTH\f[R] (see the \f[B]ENVIRONMENT VARIABLES\f[R]
section).
This is a \f[B]non-portable extension\f[R].
-.IP "18." 4
+.IP "21." 4
\f[B]global_stacks()\f[R]: \f[B]0\f[R] if global stacks are not enabled
with the \f[B]-g\f[R] or \f[B]--global-stacks\f[R] options, non-zero
otherwise.
See the \f[B]OPTIONS\f[R] section.
This is a \f[B]non-portable extension\f[R].
-.IP "19." 4
+.IP "22." 4
\f[B]leading_zero()\f[R]: \f[B]0\f[R] if leading zeroes are not enabled
with the \f[B]-z\f[R] or \f[B]\[en]leading-zeroes\f[R] options, non-zero
otherwise.
@@ -1026,6 +1040,25 @@ The \f[B]if\f[R] \f[B]else\f[R] statement does the same thing as in C.
The \f[B]quit\f[R] statement causes bc(1) to quit, even if it is on a
branch that will not be executed (it is a compile-time command).
.PP
+\f[B]Warning\f[R]: The behavior of this bc(1) on \f[B]quit\f[R] is
+slightly different from other bc(1) implementations.
+Other bc(1) implementations will exit as soon as they finish parsing the
+line that a \f[B]quit\f[R] command is on.
+This bc(1) will execute any completed and executable statements that
+occur before the \f[B]quit\f[R] statement before exiting.
+.PP
+In other words, for the bc(1) code below:
+.IP
+.nf
+\f[C]
+for (i = 0; i < 3; ++i) i; quit
+\f[R]
+.fi
+.PP
+Other bc(1) implementations will print nothing, and this bc(1) will
+print \f[B]0\f[R], \f[B]1\f[R], and \f[B]2\f[R] on successive lines
+before exiting.
+.PP
The \f[B]halt\f[R] statement causes bc(1) to quit, if it is executed.
(Unlike \f[B]quit\f[R] if it is on a branch of an \f[B]if\f[R] statement
that is not executed, bc(1) does not quit.)
@@ -1726,13 +1759,22 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
The flags \f[B]-efghiqsvVw\f[R], all long options, and the extensions
noted above are extensions to that specification.
.PP
+In addition, the behavior of the \f[B]quit\f[R] implements an
+interpretation of that specification that is different from all known
+implementations.
+For more information see the \f[B]Statements\f[R] subsection of the
+\f[B]SYNTAX\f[R] section.
+.PP
Note that the specification explicitly says that bc(1) only accepts
numbers that use a period (\f[B].\f[R]) as a radix point, regardless of
the value of \f[B]LC_NUMERIC\f[R].
.SH BUGS
.PP
-None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
+the \f[B]quit\f[R] statement.
+.PP
+No other bugs are known.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHORS
.PP
Gavin D.
diff --git a/manuals/bc/EHN.1.md b/manuals/bc/EHN.1.md
index 769ec4a18f64..0ea13df66b7f 100644
--- a/manuals/bc/EHN.1.md
+++ b/manuals/bc/EHN.1.md
@@ -504,40 +504,48 @@ The following are valid operands in bc(1):
7. **scale(E)**: The *scale* of **E**.
8. **abs(E)**: The absolute value of **E**. This is a **non-portable
extension**.
-9. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
+9. **is_number(E)**: **1** if the given argument is a number, **0** if it is a
+ string. This is a **non-portable extension**.
+10. **is_string(E)**: **1** if the given argument is a string, **0** if it is a
+ number. This is a **non-portable extension**.
+11. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
the base, the second is the exponent, and the third is the modulus. All
three values must be integers. The second argument must be non-negative. The
third argument must be non-zero. This is a **non-portable extension**.
-10. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
+11. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
optimization. The first expression is the dividend, and the second is the
divisor, which must be non-zero. The return value is the quotient, and the
modulus is stored in index **0** of the provided array (the last argument).
This is a **non-portable extension**.
-11. **asciify(E)**: If **E** is a string, returns a string that is the first
+12. **asciify(E)**: If **E** is a string, returns a string that is the first
letter of its argument. If it is a number, calculates the number mod **256**
and returns that number as a one-character string. This is a **non-portable
extension**.
-12. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
+13. **asciify(I[])**: A string that is made up of the characters that would
+ result from running **asciify(E)** on each element of the array identified
+ by the argument. This allows creating multi-character strings and storing
+ them. This is a **non-portable extension**.
+14. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
a non-**void** function (see the *Void Functions* subsection of the
**FUNCTIONS** section). The **E** argument(s) may also be arrays of the form
**I[]**, which will automatically be turned into array references (see the
*Array References* subsection of the **FUNCTIONS** section) if the
corresponding parameter in the function definition is an array reference.
-13. **read()**: Reads a line from **stdin** and uses that as an expression. The
+15. **read()**: Reads a line from **stdin** and uses that as an expression. The
result of that expression is the result of the **read()** operand. This is a
**non-portable extension**.
-14. **maxibase()**: The max allowable **ibase**. This is a **non-portable
+16. **maxibase()**: The max allowable **ibase**. This is a **non-portable
extension**.
-15. **maxobase()**: The max allowable **obase**. This is a **non-portable
+17. **maxobase()**: The max allowable **obase**. This is a **non-portable
extension**.
-16. **maxscale()**: The max allowable **scale**. This is a **non-portable
+18. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
-17. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
+19. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
**ENVIRONMENT VARIABLES** section). This is a **non-portable extension**.
-18. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
+20. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
or **-\-global-stacks** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
-19. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
+21. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
or **--leading-zeroes** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
@@ -811,6 +819,19 @@ The **if** **else** statement does the same thing as in C.
The **quit** statement causes bc(1) to quit, even if it is on a branch that will
not be executed (it is a compile-time command).
+**Warning**: The behavior of this bc(1) on **quit** is slightly different from
+other bc(1) implementations. Other bc(1) implementations will exit as soon as
+they finish parsing the line that a **quit** command is on. This bc(1) will
+execute any completed and executable statements that occur before the **quit**
+statement before exiting.
+
+In other words, for the bc(1) code below:
+
+ for (i = 0; i < 3; ++i) i; quit
+
+Other bc(1) implementations will print nothing, and this bc(1) will print **0**,
+**1**, and **2** on successive lines before exiting.
+
The **halt** statement causes bc(1) to quit, if it is executed. (Unlike **quit**
if it is on a branch of an **if** statement that is not executed, bc(1) does not
quit.)
@@ -1438,13 +1459,20 @@ at https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . The
flags **-efghiqsvVw**, all long options, and the extensions noted above are
extensions to that specification.
+In addition, the behavior of the **quit** implements an interpretation of that
+specification that is different from all known implementations. For more
+information see the **Statements** subsection of the **SYNTAX** section.
+
Note that the specification explicitly says that bc(1) only accepts numbers that
use a period (**.**) as a radix point, regardless of the value of
**LC_NUMERIC**.
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
+statement.
+
+No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHORS
diff --git a/manuals/bc/EN.1 b/manuals/bc/EN.1
index 082afe7d8fe6..895b21051408 100644
--- a/manuals/bc/EN.1
+++ b/manuals/bc/EN.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "BC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -633,6 +633,14 @@ This is a \f[B]non-portable extension\f[R].
\f[B]abs(E)\f[R]: The absolute value of \f[B]E\f[R].
This is a \f[B]non-portable extension\f[R].
.IP " 9." 4
+\f[B]is_number(E)\f[R]: \f[B]1\f[R] if the given argument is a number,
+\f[B]0\f[R] if it is a string.
+This is a \f[B]non-portable extension\f[R].
+.IP "10." 4
+\f[B]is_string(E)\f[R]: \f[B]1\f[R] if the given argument is a string,
+\f[B]0\f[R] if it is a number.
+This is a \f[B]non-portable extension\f[R].
+.IP "11." 4
\f[B]modexp(E, E, E)\f[R]: Modular exponentiation, where the first
expression is the base, the second is the exponent, and the third is the
modulus.
@@ -640,7 +648,7 @@ All three values must be integers.
The second argument must be non-negative.
The third argument must be non-zero.
This is a \f[B]non-portable extension\f[R].
-.IP "10." 4
+.IP "12." 4
\f[B]divmod(E, E, I[])\f[R]: Division and modulus in one operation.
This is for optimization.
The first expression is the dividend, and the second is the divisor,
@@ -648,13 +656,19 @@ which must be non-zero.
The return value is the quotient, and the modulus is stored in index
\f[B]0\f[R] of the provided array (the last argument).
This is a \f[B]non-portable extension\f[R].
-.IP "11." 4
+.IP "13." 4
\f[B]asciify(E)\f[R]: If \f[B]E\f[R] is a string, returns a string that
is the first letter of its argument.
If it is a number, calculates the number mod \f[B]256\f[R] and returns
that number as a one-character string.
This is a \f[B]non-portable extension\f[R].
-.IP "12." 4
+.IP "14." 4
+\f[B]asciify(I[])\f[R]: A string that is made up of the characters that
+would result from running \f[B]asciify(E)\f[R] on each element of the
+array identified by the argument.
+This allows creating multi-character strings and storing them.
+This is a \f[B]non-portable extension\f[R].
+.IP "15." 4
\f[B]I()\f[R], \f[B]I(E)\f[R], \f[B]I(E, E)\f[R], and so on, where
\f[B]I\f[R] is an identifier for a non-\f[B]void\f[R] function (see the
\f[I]Void Functions\f[R] subsection of the \f[B]FUNCTIONS\f[R] section).
@@ -663,33 +677,33 @@ The \f[B]E\f[R] argument(s) may also be arrays of the form
(see the \f[I]Array References\f[R] subsection of the
\f[B]FUNCTIONS\f[R] section) if the corresponding parameter in the
function definition is an array reference.
-.IP "13." 4
+.IP "16." 4
\f[B]read()\f[R]: Reads a line from \f[B]stdin\f[R] and uses that as an
expression.
The result of that expression is the result of the \f[B]read()\f[R]
operand.
This is a \f[B]non-portable extension\f[R].
-.IP "14." 4
+.IP "17." 4
\f[B]maxibase()\f[R]: The max allowable \f[B]ibase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "15." 4
+.IP "18." 4
\f[B]maxobase()\f[R]: The max allowable \f[B]obase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "16." 4
+.IP "19." 4
\f[B]maxscale()\f[R]: The max allowable \f[B]scale\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "17." 4
+.IP "20." 4
\f[B]line_length()\f[R]: The line length set with
\f[B]BC_LINE_LENGTH\f[R] (see the \f[B]ENVIRONMENT VARIABLES\f[R]
section).
This is a \f[B]non-portable extension\f[R].
-.IP "18." 4
+.IP "21." 4
\f[B]global_stacks()\f[R]: \f[B]0\f[R] if global stacks are not enabled
with the \f[B]-g\f[R] or \f[B]--global-stacks\f[R] options, non-zero
otherwise.
See the \f[B]OPTIONS\f[R] section.
This is a \f[B]non-portable extension\f[R].
-.IP "19." 4
+.IP "22." 4
\f[B]leading_zero()\f[R]: \f[B]0\f[R] if leading zeroes are not enabled
with the \f[B]-z\f[R] or \f[B]\[en]leading-zeroes\f[R] options, non-zero
otherwise.
@@ -1026,6 +1040,25 @@ The \f[B]if\f[R] \f[B]else\f[R] statement does the same thing as in C.
The \f[B]quit\f[R] statement causes bc(1) to quit, even if it is on a
branch that will not be executed (it is a compile-time command).
.PP
+\f[B]Warning\f[R]: The behavior of this bc(1) on \f[B]quit\f[R] is
+slightly different from other bc(1) implementations.
+Other bc(1) implementations will exit as soon as they finish parsing the
+line that a \f[B]quit\f[R] command is on.
+This bc(1) will execute any completed and executable statements that
+occur before the \f[B]quit\f[R] statement before exiting.
+.PP
+In other words, for the bc(1) code below:
+.IP
+.nf
+\f[C]
+for (i = 0; i < 3; ++i) i; quit
+\f[R]
+.fi
+.PP
+Other bc(1) implementations will print nothing, and this bc(1) will
+print \f[B]0\f[R], \f[B]1\f[R], and \f[B]2\f[R] on successive lines
+before exiting.
+.PP
The \f[B]halt\f[R] statement causes bc(1) to quit, if it is executed.
(Unlike \f[B]quit\f[R] if it is on a branch of an \f[B]if\f[R] statement
that is not executed, bc(1) does not quit.)
@@ -1755,13 +1788,22 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
The flags \f[B]-efghiqsvVw\f[R], all long options, and the extensions
noted above are extensions to that specification.
.PP
+In addition, the behavior of the \f[B]quit\f[R] implements an
+interpretation of that specification that is different from all known
+implementations.
+For more information see the \f[B]Statements\f[R] subsection of the
+\f[B]SYNTAX\f[R] section.
+.PP
Note that the specification explicitly says that bc(1) only accepts
numbers that use a period (\f[B].\f[R]) as a radix point, regardless of
the value of \f[B]LC_NUMERIC\f[R].
.SH BUGS
.PP
-None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
+the \f[B]quit\f[R] statement.
+.PP
+No other bugs are known.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHORS
.PP
Gavin D.
diff --git a/manuals/bc/EN.1.md b/manuals/bc/EN.1.md
index 2e76a2d3b289..6fb521188cc0 100644
--- a/manuals/bc/EN.1.md
+++ b/manuals/bc/EN.1.md
@@ -504,40 +504,48 @@ The following are valid operands in bc(1):
7. **scale(E)**: The *scale* of **E**.
8. **abs(E)**: The absolute value of **E**. This is a **non-portable
extension**.
-9. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
+9. **is_number(E)**: **1** if the given argument is a number, **0** if it is a
+ string. This is a **non-portable extension**.
+10. **is_string(E)**: **1** if the given argument is a string, **0** if it is a
+ number. This is a **non-portable extension**.
+11. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
the base, the second is the exponent, and the third is the modulus. All
three values must be integers. The second argument must be non-negative. The
third argument must be non-zero. This is a **non-portable extension**.
-10. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
+11. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
optimization. The first expression is the dividend, and the second is the
divisor, which must be non-zero. The return value is the quotient, and the
modulus is stored in index **0** of the provided array (the last argument).
This is a **non-portable extension**.
-11. **asciify(E)**: If **E** is a string, returns a string that is the first
+12. **asciify(E)**: If **E** is a string, returns a string that is the first
letter of its argument. If it is a number, calculates the number mod **256**
and returns that number as a one-character string. This is a **non-portable
extension**.
-12. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
+13. **asciify(I[])**: A string that is made up of the characters that would
+ result from running **asciify(E)** on each element of the array identified
+ by the argument. This allows creating multi-character strings and storing
+ them. This is a **non-portable extension**.
+14. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
a non-**void** function (see the *Void Functions* subsection of the
**FUNCTIONS** section). The **E** argument(s) may also be arrays of the form
**I[]**, which will automatically be turned into array references (see the
*Array References* subsection of the **FUNCTIONS** section) if the
corresponding parameter in the function definition is an array reference.
-13. **read()**: Reads a line from **stdin** and uses that as an expression. The
+15. **read()**: Reads a line from **stdin** and uses that as an expression. The
result of that expression is the result of the **read()** operand. This is a
**non-portable extension**.
-14. **maxibase()**: The max allowable **ibase**. This is a **non-portable
+16. **maxibase()**: The max allowable **ibase**. This is a **non-portable
extension**.
-15. **maxobase()**: The max allowable **obase**. This is a **non-portable
+17. **maxobase()**: The max allowable **obase**. This is a **non-portable
extension**.
-16. **maxscale()**: The max allowable **scale**. This is a **non-portable
+18. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
-17. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
+19. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
**ENVIRONMENT VARIABLES** section). This is a **non-portable extension**.
-18. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
+20. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
or **-\-global-stacks** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
-19. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
+21. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
or **--leading-zeroes** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
@@ -811,6 +819,19 @@ The **if** **else** statement does the same thing as in C.
The **quit** statement causes bc(1) to quit, even if it is on a branch that will
not be executed (it is a compile-time command).
+**Warning**: The behavior of this bc(1) on **quit** is slightly different from
+other bc(1) implementations. Other bc(1) implementations will exit as soon as
+they finish parsing the line that a **quit** command is on. This bc(1) will
+execute any completed and executable statements that occur before the **quit**
+statement before exiting.
+
+In other words, for the bc(1) code below:
+
+ for (i = 0; i < 3; ++i) i; quit
+
+Other bc(1) implementations will print nothing, and this bc(1) will print **0**,
+**1**, and **2** on successive lines before exiting.
+
The **halt** statement causes bc(1) to quit, if it is executed. (Unlike **quit**
if it is on a branch of an **if** statement that is not executed, bc(1) does not
quit.)
@@ -1464,13 +1485,20 @@ at https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . The
flags **-efghiqsvVw**, all long options, and the extensions noted above are
extensions to that specification.
+In addition, the behavior of the **quit** implements an interpretation of that
+specification that is different from all known implementations. For more
+information see the **Statements** subsection of the **SYNTAX** section.
+
Note that the specification explicitly says that bc(1) only accepts numbers that
use a period (**.**) as a radix point, regardless of the value of
**LC_NUMERIC**.
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
+statement.
+
+No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHORS
diff --git a/manuals/bc/H.1 b/manuals/bc/H.1
index 750b38976a26..72d561fdea00 100644
--- a/manuals/bc/H.1
+++ b/manuals/bc/H.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "BC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -711,6 +711,14 @@ This is a \f[B]non-portable extension\f[R].
\f[B]abs(E)\f[R]: The absolute value of \f[B]E\f[R].
This is a \f[B]non-portable extension\f[R].
.IP " 9." 4
+\f[B]is_number(E)\f[R]: \f[B]1\f[R] if the given argument is a number,
+\f[B]0\f[R] if it is a string.
+This is a \f[B]non-portable extension\f[R].
+.IP "10." 4
+\f[B]is_string(E)\f[R]: \f[B]1\f[R] if the given argument is a string,
+\f[B]0\f[R] if it is a number.
+This is a \f[B]non-portable extension\f[R].
+.IP "11." 4
\f[B]modexp(E, E, E)\f[R]: Modular exponentiation, where the first
expression is the base, the second is the exponent, and the third is the
modulus.
@@ -718,7 +726,7 @@ All three values must be integers.
The second argument must be non-negative.
The third argument must be non-zero.
This is a \f[B]non-portable extension\f[R].
-.IP "10." 4
+.IP "12." 4
\f[B]divmod(E, E, I[])\f[R]: Division and modulus in one operation.
This is for optimization.
The first expression is the dividend, and the second is the divisor,
@@ -726,13 +734,19 @@ which must be non-zero.
The return value is the quotient, and the modulus is stored in index
\f[B]0\f[R] of the provided array (the last argument).
This is a \f[B]non-portable extension\f[R].
-.IP "11." 4
+.IP "13." 4
\f[B]asciify(E)\f[R]: If \f[B]E\f[R] is a string, returns a string that
is the first letter of its argument.
If it is a number, calculates the number mod \f[B]256\f[R] and returns
that number as a one-character string.
This is a \f[B]non-portable extension\f[R].
-.IP "12." 4
+.IP "14." 4
+\f[B]asciify(I[])\f[R]: A string that is made up of the characters that
+would result from running \f[B]asciify(E)\f[R] on each element of the
+array identified by the argument.
+This allows creating multi-character strings and storing them.
+This is a \f[B]non-portable extension\f[R].
+.IP "15." 4
\f[B]I()\f[R], \f[B]I(E)\f[R], \f[B]I(E, E)\f[R], and so on, where
\f[B]I\f[R] is an identifier for a non-\f[B]void\f[R] function (see the
\f[I]Void Functions\f[R] subsection of the \f[B]FUNCTIONS\f[R] section).
@@ -741,44 +755,44 @@ The \f[B]E\f[R] argument(s) may also be arrays of the form
(see the \f[I]Array References\f[R] subsection of the
\f[B]FUNCTIONS\f[R] section) if the corresponding parameter in the
function definition is an array reference.
-.IP "13." 4
+.IP "16." 4
\f[B]read()\f[R]: Reads a line from \f[B]stdin\f[R] and uses that as an
expression.
The result of that expression is the result of the \f[B]read()\f[R]
operand.
This is a \f[B]non-portable extension\f[R].
-.IP "14." 4
+.IP "17." 4
\f[B]maxibase()\f[R]: The max allowable \f[B]ibase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "15." 4
+.IP "18." 4
\f[B]maxobase()\f[R]: The max allowable \f[B]obase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "16." 4
+.IP "19." 4
\f[B]maxscale()\f[R]: The max allowable \f[B]scale\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "17." 4
+.IP "20." 4
\f[B]line_length()\f[R]: The line length set with
\f[B]BC_LINE_LENGTH\f[R] (see the \f[B]ENVIRONMENT VARIABLES\f[R]
section).
This is a \f[B]non-portable extension\f[R].
-.IP "18." 4
+.IP "21." 4
\f[B]global_stacks()\f[R]: \f[B]0\f[R] if global stacks are not enabled
with the \f[B]-g\f[R] or \f[B]--global-stacks\f[R] options, non-zero
otherwise.
See the \f[B]OPTIONS\f[R] section.
This is a \f[B]non-portable extension\f[R].
-.IP "19." 4
+.IP "22." 4
\f[B]leading_zero()\f[R]: \f[B]0\f[R] if leading zeroes are not enabled
with the \f[B]-z\f[R] or \f[B]\[en]leading-zeroes\f[R] options, non-zero
otherwise.
See the \f[B]OPTIONS\f[R] section.
This is a \f[B]non-portable extension\f[R].
-.IP "20." 4
+.IP "23." 4
\f[B]rand()\f[R]: A pseudo-random integer between \f[B]0\f[R]
(inclusive) and \f[B]BC_RAND_MAX\f[R] (inclusive).
Using this operand will change the value of \f[B]seed\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "21." 4
+.IP "24." 4
\f[B]irand(E)\f[R]: A pseudo-random integer between \f[B]0\f[R]
(inclusive) and the value of \f[B]E\f[R] (exclusive).
If \f[B]E\f[R] is negative or is a non-integer (\f[B]E\f[R]\[cq]s
@@ -796,7 +810,7 @@ value of \f[B]E\f[R] is \f[B]0\f[R] or \f[B]1\f[R].
In that case, \f[B]0\f[R] is returned, and \f[B]seed\f[R] is
\f[I]not\f[R] changed.
This is a \f[B]non-portable extension\f[R].
-.IP "22." 4
+.IP "25." 4
\f[B]maxrand()\f[R]: The max integer returned by \f[B]rand()\f[R].
This is a \f[B]non-portable extension\f[R].
.PP
@@ -1247,6 +1261,25 @@ The \f[B]if\f[R] \f[B]else\f[R] statement does the same thing as in C.
The \f[B]quit\f[R] statement causes bc(1) to quit, even if it is on a
branch that will not be executed (it is a compile-time command).
.PP
+\f[B]Warning\f[R]: The behavior of this bc(1) on \f[B]quit\f[R] is
+slightly different from other bc(1) implementations.
+Other bc(1) implementations will exit as soon as they finish parsing the
+line that a \f[B]quit\f[R] command is on.
+This bc(1) will execute any completed and executable statements that
+occur before the \f[B]quit\f[R] statement before exiting.
+.PP
+In other words, for the bc(1) code below:
+.IP
+.nf
+\f[C]
+for (i = 0; i < 3; ++i) i; quit
+\f[R]
+.fi
+.PP
+Other bc(1) implementations will print nothing, and this bc(1) will
+print \f[B]0\f[R], \f[B]1\f[R], and \f[B]2\f[R] on successive lines
+before exiting.
+.PP
The \f[B]halt\f[R] statement causes bc(1) to quit, if it is executed.
(Unlike \f[B]quit\f[R] if it is on a branch of an \f[B]if\f[R] statement
that is not executed, bc(1) does not quit.)
@@ -2897,6 +2930,12 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
The flags \f[B]-efghiqsvVw\f[R], all long options, and the extensions
noted above are extensions to that specification.
.PP
+In addition, the behavior of the \f[B]quit\f[R] implements an
+interpretation of that specification that is different from all known
+implementations.
+For more information see the \f[B]Statements\f[R] subsection of the
+\f[B]SYNTAX\f[R] section.
+.PP
Note that the specification explicitly says that bc(1) only accepts
numbers that use a period (\f[B].\f[R]) as a radix point, regardless of
the value of \f[B]LC_NUMERIC\f[R].
@@ -2905,8 +2944,11 @@ This bc(1) supports error messages for different locales, and thus, it
supports \f[B]LC_MESSAGES\f[R].
.SH BUGS
.PP
-None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
+the \f[B]quit\f[R] statement.
+.PP
+No other bugs are known.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHORS
.PP
Gavin D.
diff --git a/manuals/bc/H.1.md b/manuals/bc/H.1.md
index b242b7cfa393..669aa1b1bf37 100644
--- a/manuals/bc/H.1.md
+++ b/manuals/bc/H.1.md
@@ -558,46 +558,54 @@ The following are valid operands in bc(1):
7. **scale(E)**: The *scale* of **E**.
8. **abs(E)**: The absolute value of **E**. This is a **non-portable
extension**.
-9. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
+9. **is_number(E)**: **1** if the given argument is a number, **0** if it is a
+ string. This is a **non-portable extension**.
+10. **is_string(E)**: **1** if the given argument is a string, **0** if it is a
+ number. This is a **non-portable extension**.
+11. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
the base, the second is the exponent, and the third is the modulus. All
three values must be integers. The second argument must be non-negative. The
third argument must be non-zero. This is a **non-portable extension**.
-10. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
+11. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
optimization. The first expression is the dividend, and the second is the
divisor, which must be non-zero. The return value is the quotient, and the
modulus is stored in index **0** of the provided array (the last argument).
This is a **non-portable extension**.
-11. **asciify(E)**: If **E** is a string, returns a string that is the first
+12. **asciify(E)**: If **E** is a string, returns a string that is the first
letter of its argument. If it is a number, calculates the number mod **256**
and returns that number as a one-character string. This is a **non-portable
extension**.
-12. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
+13. **asciify(I[])**: A string that is made up of the characters that would
+ result from running **asciify(E)** on each element of the array identified
+ by the argument. This allows creating multi-character strings and storing
+ them. This is a **non-portable extension**.
+14. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
a non-**void** function (see the *Void Functions* subsection of the
**FUNCTIONS** section). The **E** argument(s) may also be arrays of the form
**I[]**, which will automatically be turned into array references (see the
*Array References* subsection of the **FUNCTIONS** section) if the
corresponding parameter in the function definition is an array reference.
-13. **read()**: Reads a line from **stdin** and uses that as an expression. The
+15. **read()**: Reads a line from **stdin** and uses that as an expression. The
result of that expression is the result of the **read()** operand. This is a
**non-portable extension**.
-14. **maxibase()**: The max allowable **ibase**. This is a **non-portable
+16. **maxibase()**: The max allowable **ibase**. This is a **non-portable
extension**.
-15. **maxobase()**: The max allowable **obase**. This is a **non-portable
+17. **maxobase()**: The max allowable **obase**. This is a **non-portable
extension**.
-16. **maxscale()**: The max allowable **scale**. This is a **non-portable
+18. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
-17. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
+19. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
**ENVIRONMENT VARIABLES** section). This is a **non-portable extension**.
-18. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
+20. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
or **-\-global-stacks** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
-19. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
+21. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
or **--leading-zeroes** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
-20. **rand()**: A pseudo-random integer between **0** (inclusive) and
+22. **rand()**: A pseudo-random integer between **0** (inclusive) and
**BC_RAND_MAX** (inclusive). Using this operand will change the value of
**seed**. This is a **non-portable extension**.
-21. **irand(E)**: A pseudo-random integer between **0** (inclusive) and the
+23. **irand(E)**: A pseudo-random integer between **0** (inclusive) and the
value of **E** (exclusive). If **E** is negative or is a non-integer
(**E**'s *scale* is not **0**), an error is raised, and bc(1) resets (see
the **RESET** section) while **seed** remains unchanged. If **E** is larger
@@ -608,7 +616,7 @@ The following are valid operands in bc(1):
change the value of **seed**, unless the value of **E** is **0** or **1**.
In that case, **0** is returned, and **seed** is *not* changed. This is a
**non-portable extension**.
-22. **maxrand()**: The max integer returned by **rand()**. This is a
+24. **maxrand()**: The max integer returned by **rand()**. This is a
**non-portable extension**.
The integers generated by **rand()** and **irand(E)** are guaranteed to be as
@@ -976,6 +984,19 @@ The **if** **else** statement does the same thing as in C.
The **quit** statement causes bc(1) to quit, even if it is on a branch that will
not be executed (it is a compile-time command).
+**Warning**: The behavior of this bc(1) on **quit** is slightly different from
+other bc(1) implementations. Other bc(1) implementations will exit as soon as
+they finish parsing the line that a **quit** command is on. This bc(1) will
+execute any completed and executable statements that occur before the **quit**
+statement before exiting.
+
+In other words, for the bc(1) code below:
+
+ for (i = 0; i < 3; ++i) i; quit
+
+Other bc(1) implementations will print nothing, and this bc(1) will print **0**,
+**1**, and **2** on successive lines before exiting.
+
The **halt** statement causes bc(1) to quit, if it is executed. (Unlike **quit**
if it is on a branch of an **if** statement that is not executed, bc(1) does not
quit.)
@@ -2435,6 +2456,10 @@ at https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . The
flags **-efghiqsvVw**, all long options, and the extensions noted above are
extensions to that specification.
+In addition, the behavior of the **quit** implements an interpretation of that
+specification that is different from all known implementations. For more
+information see the **Statements** subsection of the **SYNTAX** section.
+
Note that the specification explicitly says that bc(1) only accepts numbers that
use a period (**.**) as a radix point, regardless of the value of
**LC_NUMERIC**.
@@ -2444,7 +2469,10 @@ This bc(1) supports error messages for different locales, and thus, it supports
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
+statement.
+
+No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHORS
diff --git a/manuals/bc/HN.1 b/manuals/bc/HN.1
index afecefae65f0..b90c88fb59b6 100644
--- a/manuals/bc/HN.1
+++ b/manuals/bc/HN.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "BC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -711,6 +711,14 @@ This is a \f[B]non-portable extension\f[R].
\f[B]abs(E)\f[R]: The absolute value of \f[B]E\f[R].
This is a \f[B]non-portable extension\f[R].
.IP " 9." 4
+\f[B]is_number(E)\f[R]: \f[B]1\f[R] if the given argument is a number,
+\f[B]0\f[R] if it is a string.
+This is a \f[B]non-portable extension\f[R].
+.IP "10." 4
+\f[B]is_string(E)\f[R]: \f[B]1\f[R] if the given argument is a string,
+\f[B]0\f[R] if it is a number.
+This is a \f[B]non-portable extension\f[R].
+.IP "11." 4
\f[B]modexp(E, E, E)\f[R]: Modular exponentiation, where the first
expression is the base, the second is the exponent, and the third is the
modulus.
@@ -718,7 +726,7 @@ All three values must be integers.
The second argument must be non-negative.
The third argument must be non-zero.
This is a \f[B]non-portable extension\f[R].
-.IP "10." 4
+.IP "12." 4
\f[B]divmod(E, E, I[])\f[R]: Division and modulus in one operation.
This is for optimization.
The first expression is the dividend, and the second is the divisor,
@@ -726,13 +734,19 @@ which must be non-zero.
The return value is the quotient, and the modulus is stored in index
\f[B]0\f[R] of the provided array (the last argument).
This is a \f[B]non-portable extension\f[R].
-.IP "11." 4
+.IP "13." 4
\f[B]asciify(E)\f[R]: If \f[B]E\f[R] is a string, returns a string that
is the first letter of its argument.
If it is a number, calculates the number mod \f[B]256\f[R] and returns
that number as a one-character string.
This is a \f[B]non-portable extension\f[R].
-.IP "12." 4
+.IP "14." 4
+\f[B]asciify(I[])\f[R]: A string that is made up of the characters that
+would result from running \f[B]asciify(E)\f[R] on each element of the
+array identified by the argument.
+This allows creating multi-character strings and storing them.
+This is a \f[B]non-portable extension\f[R].
+.IP "15." 4
\f[B]I()\f[R], \f[B]I(E)\f[R], \f[B]I(E, E)\f[R], and so on, where
\f[B]I\f[R] is an identifier for a non-\f[B]void\f[R] function (see the
\f[I]Void Functions\f[R] subsection of the \f[B]FUNCTIONS\f[R] section).
@@ -741,44 +755,44 @@ The \f[B]E\f[R] argument(s) may also be arrays of the form
(see the \f[I]Array References\f[R] subsection of the
\f[B]FUNCTIONS\f[R] section) if the corresponding parameter in the
function definition is an array reference.
-.IP "13." 4
+.IP "16." 4
\f[B]read()\f[R]: Reads a line from \f[B]stdin\f[R] and uses that as an
expression.
The result of that expression is the result of the \f[B]read()\f[R]
operand.
This is a \f[B]non-portable extension\f[R].
-.IP "14." 4
+.IP "17." 4
\f[B]maxibase()\f[R]: The max allowable \f[B]ibase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "15." 4
+.IP "18." 4
\f[B]maxobase()\f[R]: The max allowable \f[B]obase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "16." 4
+.IP "19." 4
\f[B]maxscale()\f[R]: The max allowable \f[B]scale\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "17." 4
+.IP "20." 4
\f[B]line_length()\f[R]: The line length set with
\f[B]BC_LINE_LENGTH\f[R] (see the \f[B]ENVIRONMENT VARIABLES\f[R]
section).
This is a \f[B]non-portable extension\f[R].
-.IP "18." 4
+.IP "21." 4
\f[B]global_stacks()\f[R]: \f[B]0\f[R] if global stacks are not enabled
with the \f[B]-g\f[R] or \f[B]--global-stacks\f[R] options, non-zero
otherwise.
See the \f[B]OPTIONS\f[R] section.
This is a \f[B]non-portable extension\f[R].
-.IP "19." 4
+.IP "22." 4
\f[B]leading_zero()\f[R]: \f[B]0\f[R] if leading zeroes are not enabled
with the \f[B]-z\f[R] or \f[B]\[en]leading-zeroes\f[R] options, non-zero
otherwise.
See the \f[B]OPTIONS\f[R] section.
This is a \f[B]non-portable extension\f[R].
-.IP "20." 4
+.IP "23." 4
\f[B]rand()\f[R]: A pseudo-random integer between \f[B]0\f[R]
(inclusive) and \f[B]BC_RAND_MAX\f[R] (inclusive).
Using this operand will change the value of \f[B]seed\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "21." 4
+.IP "24." 4
\f[B]irand(E)\f[R]: A pseudo-random integer between \f[B]0\f[R]
(inclusive) and the value of \f[B]E\f[R] (exclusive).
If \f[B]E\f[R] is negative or is a non-integer (\f[B]E\f[R]\[cq]s
@@ -796,7 +810,7 @@ value of \f[B]E\f[R] is \f[B]0\f[R] or \f[B]1\f[R].
In that case, \f[B]0\f[R] is returned, and \f[B]seed\f[R] is
\f[I]not\f[R] changed.
This is a \f[B]non-portable extension\f[R].
-.IP "22." 4
+.IP "25." 4
\f[B]maxrand()\f[R]: The max integer returned by \f[B]rand()\f[R].
This is a \f[B]non-portable extension\f[R].
.PP
@@ -1247,6 +1261,25 @@ The \f[B]if\f[R] \f[B]else\f[R] statement does the same thing as in C.
The \f[B]quit\f[R] statement causes bc(1) to quit, even if it is on a
branch that will not be executed (it is a compile-time command).
.PP
+\f[B]Warning\f[R]: The behavior of this bc(1) on \f[B]quit\f[R] is
+slightly different from other bc(1) implementations.
+Other bc(1) implementations will exit as soon as they finish parsing the
+line that a \f[B]quit\f[R] command is on.
+This bc(1) will execute any completed and executable statements that
+occur before the \f[B]quit\f[R] statement before exiting.
+.PP
+In other words, for the bc(1) code below:
+.IP
+.nf
+\f[C]
+for (i = 0; i < 3; ++i) i; quit
+\f[R]
+.fi
+.PP
+Other bc(1) implementations will print nothing, and this bc(1) will
+print \f[B]0\f[R], \f[B]1\f[R], and \f[B]2\f[R] on successive lines
+before exiting.
+.PP
The \f[B]halt\f[R] statement causes bc(1) to quit, if it is executed.
(Unlike \f[B]quit\f[R] if it is on a branch of an \f[B]if\f[R] statement
that is not executed, bc(1) does not quit.)
@@ -2893,13 +2926,22 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
The flags \f[B]-efghiqsvVw\f[R], all long options, and the extensions
noted above are extensions to that specification.
.PP
+In addition, the behavior of the \f[B]quit\f[R] implements an
+interpretation of that specification that is different from all known
+implementations.
+For more information see the \f[B]Statements\f[R] subsection of the
+\f[B]SYNTAX\f[R] section.
+.PP
Note that the specification explicitly says that bc(1) only accepts
numbers that use a period (\f[B].\f[R]) as a radix point, regardless of
the value of \f[B]LC_NUMERIC\f[R].
.SH BUGS
.PP
-None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
+the \f[B]quit\f[R] statement.
+.PP
+No other bugs are known.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHORS
.PP
Gavin D.
diff --git a/manuals/bc/HN.1.md b/manuals/bc/HN.1.md
index 2e89cd559804..cf4a9d4024f1 100644
--- a/manuals/bc/HN.1.md
+++ b/manuals/bc/HN.1.md
@@ -558,46 +558,54 @@ The following are valid operands in bc(1):
7. **scale(E)**: The *scale* of **E**.
8. **abs(E)**: The absolute value of **E**. This is a **non-portable
extension**.
-9. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
+9. **is_number(E)**: **1** if the given argument is a number, **0** if it is a
+ string. This is a **non-portable extension**.
+10. **is_string(E)**: **1** if the given argument is a string, **0** if it is a
+ number. This is a **non-portable extension**.
+11. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
the base, the second is the exponent, and the third is the modulus. All
three values must be integers. The second argument must be non-negative. The
third argument must be non-zero. This is a **non-portable extension**.
-10. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
+11. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
optimization. The first expression is the dividend, and the second is the
divisor, which must be non-zero. The return value is the quotient, and the
modulus is stored in index **0** of the provided array (the last argument).
This is a **non-portable extension**.
-11. **asciify(E)**: If **E** is a string, returns a string that is the first
+12. **asciify(E)**: If **E** is a string, returns a string that is the first
letter of its argument. If it is a number, calculates the number mod **256**
and returns that number as a one-character string. This is a **non-portable
extension**.
-12. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
+13. **asciify(I[])**: A string that is made up of the characters that would
+ result from running **asciify(E)** on each element of the array identified
+ by the argument. This allows creating multi-character strings and storing
+ them. This is a **non-portable extension**.
+14. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
a non-**void** function (see the *Void Functions* subsection of the
**FUNCTIONS** section). The **E** argument(s) may also be arrays of the form
**I[]**, which will automatically be turned into array references (see the
*Array References* subsection of the **FUNCTIONS** section) if the
corresponding parameter in the function definition is an array reference.
-13. **read()**: Reads a line from **stdin** and uses that as an expression. The
+15. **read()**: Reads a line from **stdin** and uses that as an expression. The
result of that expression is the result of the **read()** operand. This is a
**non-portable extension**.
-14. **maxibase()**: The max allowable **ibase**. This is a **non-portable
+16. **maxibase()**: The max allowable **ibase**. This is a **non-portable
extension**.
-15. **maxobase()**: The max allowable **obase**. This is a **non-portable
+17. **maxobase()**: The max allowable **obase**. This is a **non-portable
extension**.
-16. **maxscale()**: The max allowable **scale**. This is a **non-portable
+18. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
-17. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
+19. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
**ENVIRONMENT VARIABLES** section). This is a **non-portable extension**.
-18. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
+20. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
or **-\-global-stacks** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
-19. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
+21. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
or **--leading-zeroes** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
-20. **rand()**: A pseudo-random integer between **0** (inclusive) and
+22. **rand()**: A pseudo-random integer between **0** (inclusive) and
**BC_RAND_MAX** (inclusive). Using this operand will change the value of
**seed**. This is a **non-portable extension**.
-21. **irand(E)**: A pseudo-random integer between **0** (inclusive) and the
+23. **irand(E)**: A pseudo-random integer between **0** (inclusive) and the
value of **E** (exclusive). If **E** is negative or is a non-integer
(**E**'s *scale* is not **0**), an error is raised, and bc(1) resets (see
the **RESET** section) while **seed** remains unchanged. If **E** is larger
@@ -608,7 +616,7 @@ The following are valid operands in bc(1):
change the value of **seed**, unless the value of **E** is **0** or **1**.
In that case, **0** is returned, and **seed** is *not* changed. This is a
**non-portable extension**.
-22. **maxrand()**: The max integer returned by **rand()**. This is a
+24. **maxrand()**: The max integer returned by **rand()**. This is a
**non-portable extension**.
The integers generated by **rand()** and **irand(E)** are guaranteed to be as
@@ -976,6 +984,19 @@ The **if** **else** statement does the same thing as in C.
The **quit** statement causes bc(1) to quit, even if it is on a branch that will
not be executed (it is a compile-time command).
+**Warning**: The behavior of this bc(1) on **quit** is slightly different from
+other bc(1) implementations. Other bc(1) implementations will exit as soon as
+they finish parsing the line that a **quit** command is on. This bc(1) will
+execute any completed and executable statements that occur before the **quit**
+statement before exiting.
+
+In other words, for the bc(1) code below:
+
+ for (i = 0; i < 3; ++i) i; quit
+
+Other bc(1) implementations will print nothing, and this bc(1) will print **0**,
+**1**, and **2** on successive lines before exiting.
+
The **halt** statement causes bc(1) to quit, if it is executed. (Unlike **quit**
if it is on a branch of an **if** statement that is not executed, bc(1) does not
quit.)
@@ -2430,13 +2451,20 @@ at https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . The
flags **-efghiqsvVw**, all long options, and the extensions noted above are
extensions to that specification.
+In addition, the behavior of the **quit** implements an interpretation of that
+specification that is different from all known implementations. For more
+information see the **Statements** subsection of the **SYNTAX** section.
+
Note that the specification explicitly says that bc(1) only accepts numbers that
use a period (**.**) as a radix point, regardless of the value of
**LC_NUMERIC**.
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
+statement.
+
+No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHORS
diff --git a/manuals/bc/N.1 b/manuals/bc/N.1
index 88603995ca73..378094edeaf0 100644
--- a/manuals/bc/N.1
+++ b/manuals/bc/N.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "BC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "BC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH NAME
@@ -711,6 +711,14 @@ This is a \f[B]non-portable extension\f[R].
\f[B]abs(E)\f[R]: The absolute value of \f[B]E\f[R].
This is a \f[B]non-portable extension\f[R].
.IP " 9." 4
+\f[B]is_number(E)\f[R]: \f[B]1\f[R] if the given argument is a number,
+\f[B]0\f[R] if it is a string.
+This is a \f[B]non-portable extension\f[R].
+.IP "10." 4
+\f[B]is_string(E)\f[R]: \f[B]1\f[R] if the given argument is a string,
+\f[B]0\f[R] if it is a number.
+This is a \f[B]non-portable extension\f[R].
+.IP "11." 4
\f[B]modexp(E, E, E)\f[R]: Modular exponentiation, where the first
expression is the base, the second is the exponent, and the third is the
modulus.
@@ -718,7 +726,7 @@ All three values must be integers.
The second argument must be non-negative.
The third argument must be non-zero.
This is a \f[B]non-portable extension\f[R].
-.IP "10." 4
+.IP "12." 4
\f[B]divmod(E, E, I[])\f[R]: Division and modulus in one operation.
This is for optimization.
The first expression is the dividend, and the second is the divisor,
@@ -726,13 +734,19 @@ which must be non-zero.
The return value is the quotient, and the modulus is stored in index
\f[B]0\f[R] of the provided array (the last argument).
This is a \f[B]non-portable extension\f[R].
-.IP "11." 4
+.IP "13." 4
\f[B]asciify(E)\f[R]: If \f[B]E\f[R] is a string, returns a string that
is the first letter of its argument.
If it is a number, calculates the number mod \f[B]256\f[R] and returns
that number as a one-character string.
This is a \f[B]non-portable extension\f[R].
-.IP "12." 4
+.IP "14." 4
+\f[B]asciify(I[])\f[R]: A string that is made up of the characters that
+would result from running \f[B]asciify(E)\f[R] on each element of the
+array identified by the argument.
+This allows creating multi-character strings and storing them.
+This is a \f[B]non-portable extension\f[R].
+.IP "15." 4
\f[B]I()\f[R], \f[B]I(E)\f[R], \f[B]I(E, E)\f[R], and so on, where
\f[B]I\f[R] is an identifier for a non-\f[B]void\f[R] function (see the
\f[I]Void Functions\f[R] subsection of the \f[B]FUNCTIONS\f[R] section).
@@ -741,44 +755,44 @@ The \f[B]E\f[R] argument(s) may also be arrays of the form
(see the \f[I]Array References\f[R] subsection of the
\f[B]FUNCTIONS\f[R] section) if the corresponding parameter in the
function definition is an array reference.
-.IP "13." 4
+.IP "16." 4
\f[B]read()\f[R]: Reads a line from \f[B]stdin\f[R] and uses that as an
expression.
The result of that expression is the result of the \f[B]read()\f[R]
operand.
This is a \f[B]non-portable extension\f[R].
-.IP "14." 4
+.IP "17." 4
\f[B]maxibase()\f[R]: The max allowable \f[B]ibase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "15." 4
+.IP "18." 4
\f[B]maxobase()\f[R]: The max allowable \f[B]obase\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "16." 4
+.IP "19." 4
\f[B]maxscale()\f[R]: The max allowable \f[B]scale\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "17." 4
+.IP "20." 4
\f[B]line_length()\f[R]: The line length set with
\f[B]BC_LINE_LENGTH\f[R] (see the \f[B]ENVIRONMENT VARIABLES\f[R]
section).
This is a \f[B]non-portable extension\f[R].
-.IP "18." 4
+.IP "21." 4
\f[B]global_stacks()\f[R]: \f[B]0\f[R] if global stacks are not enabled
with the \f[B]-g\f[R] or \f[B]--global-stacks\f[R] options, non-zero
otherwise.
See the \f[B]OPTIONS\f[R] section.
This is a \f[B]non-portable extension\f[R].
-.IP "19." 4
+.IP "22." 4
\f[B]leading_zero()\f[R]: \f[B]0\f[R] if leading zeroes are not enabled
with the \f[B]-z\f[R] or \f[B]\[en]leading-zeroes\f[R] options, non-zero
otherwise.
See the \f[B]OPTIONS\f[R] section.
This is a \f[B]non-portable extension\f[R].
-.IP "20." 4
+.IP "23." 4
\f[B]rand()\f[R]: A pseudo-random integer between \f[B]0\f[R]
(inclusive) and \f[B]BC_RAND_MAX\f[R] (inclusive).
Using this operand will change the value of \f[B]seed\f[R].
This is a \f[B]non-portable extension\f[R].
-.IP "21." 4
+.IP "24." 4
\f[B]irand(E)\f[R]: A pseudo-random integer between \f[B]0\f[R]
(inclusive) and the value of \f[B]E\f[R] (exclusive).
If \f[B]E\f[R] is negative or is a non-integer (\f[B]E\f[R]\[cq]s
@@ -796,7 +810,7 @@ value of \f[B]E\f[R] is \f[B]0\f[R] or \f[B]1\f[R].
In that case, \f[B]0\f[R] is returned, and \f[B]seed\f[R] is
\f[I]not\f[R] changed.
This is a \f[B]non-portable extension\f[R].
-.IP "22." 4
+.IP "25." 4
\f[B]maxrand()\f[R]: The max integer returned by \f[B]rand()\f[R].
This is a \f[B]non-portable extension\f[R].
.PP
@@ -1247,6 +1261,25 @@ The \f[B]if\f[R] \f[B]else\f[R] statement does the same thing as in C.
The \f[B]quit\f[R] statement causes bc(1) to quit, even if it is on a
branch that will not be executed (it is a compile-time command).
.PP
+\f[B]Warning\f[R]: The behavior of this bc(1) on \f[B]quit\f[R] is
+slightly different from other bc(1) implementations.
+Other bc(1) implementations will exit as soon as they finish parsing the
+line that a \f[B]quit\f[R] command is on.
+This bc(1) will execute any completed and executable statements that
+occur before the \f[B]quit\f[R] statement before exiting.
+.PP
+In other words, for the bc(1) code below:
+.IP
+.nf
+\f[C]
+for (i = 0; i < 3; ++i) i; quit
+\f[R]
+.fi
+.PP
+Other bc(1) implementations will print nothing, and this bc(1) will
+print \f[B]0\f[R], \f[B]1\f[R], and \f[B]2\f[R] on successive lines
+before exiting.
+.PP
The \f[B]halt\f[R] statement causes bc(1) to quit, if it is executed.
(Unlike \f[B]quit\f[R] if it is on a branch of an \f[B]if\f[R] statement
that is not executed, bc(1) does not quit.)
@@ -2922,13 +2955,22 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
The flags \f[B]-efghiqsvVw\f[R], all long options, and the extensions
noted above are extensions to that specification.
.PP
+In addition, the behavior of the \f[B]quit\f[R] implements an
+interpretation of that specification that is different from all known
+implementations.
+For more information see the \f[B]Statements\f[R] subsection of the
+\f[B]SYNTAX\f[R] section.
+.PP
Note that the specification explicitly says that bc(1) only accepts
numbers that use a period (\f[B].\f[R]) as a radix point, regardless of
the value of \f[B]LC_NUMERIC\f[R].
.SH BUGS
.PP
-None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Before version \f[B]6.1.0\f[R], this bc(1) had incorrect behavior for
+the \f[B]quit\f[R] statement.
+.PP
+No other bugs are known.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHORS
.PP
Gavin D.
diff --git a/manuals/bc/N.1.md b/manuals/bc/N.1.md
index 33b581185abb..5ed9ed677671 100644
--- a/manuals/bc/N.1.md
+++ b/manuals/bc/N.1.md
@@ -558,46 +558,54 @@ The following are valid operands in bc(1):
7. **scale(E)**: The *scale* of **E**.
8. **abs(E)**: The absolute value of **E**. This is a **non-portable
extension**.
-9. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
+9. **is_number(E)**: **1** if the given argument is a number, **0** if it is a
+ string. This is a **non-portable extension**.
+10. **is_string(E)**: **1** if the given argument is a string, **0** if it is a
+ number. This is a **non-portable extension**.
+11. **modexp(E, E, E)**: Modular exponentiation, where the first expression is
the base, the second is the exponent, and the third is the modulus. All
three values must be integers. The second argument must be non-negative. The
third argument must be non-zero. This is a **non-portable extension**.
-10. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
+11. **divmod(E, E, I[])**: Division and modulus in one operation. This is for
optimization. The first expression is the dividend, and the second is the
divisor, which must be non-zero. The return value is the quotient, and the
modulus is stored in index **0** of the provided array (the last argument).
This is a **non-portable extension**.
-11. **asciify(E)**: If **E** is a string, returns a string that is the first
+12. **asciify(E)**: If **E** is a string, returns a string that is the first
letter of its argument. If it is a number, calculates the number mod **256**
and returns that number as a one-character string. This is a **non-portable
extension**.
-12. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
+13. **asciify(I[])**: A string that is made up of the characters that would
+ result from running **asciify(E)** on each element of the array identified
+ by the argument. This allows creating multi-character strings and storing
+ them. This is a **non-portable extension**.
+14. **I()**, **I(E)**, **I(E, E)**, and so on, where **I** is an identifier for
a non-**void** function (see the *Void Functions* subsection of the
**FUNCTIONS** section). The **E** argument(s) may also be arrays of the form
**I[]**, which will automatically be turned into array references (see the
*Array References* subsection of the **FUNCTIONS** section) if the
corresponding parameter in the function definition is an array reference.
-13. **read()**: Reads a line from **stdin** and uses that as an expression. The
+15. **read()**: Reads a line from **stdin** and uses that as an expression. The
result of that expression is the result of the **read()** operand. This is a
**non-portable extension**.
-14. **maxibase()**: The max allowable **ibase**. This is a **non-portable
+16. **maxibase()**: The max allowable **ibase**. This is a **non-portable
extension**.
-15. **maxobase()**: The max allowable **obase**. This is a **non-portable
+17. **maxobase()**: The max allowable **obase**. This is a **non-portable
extension**.
-16. **maxscale()**: The max allowable **scale**. This is a **non-portable
+18. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
-17. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
+19. **line_length()**: The line length set with **BC_LINE_LENGTH** (see the
**ENVIRONMENT VARIABLES** section). This is a **non-portable extension**.
-18. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
+20. **global_stacks()**: **0** if global stacks are not enabled with the **-g**
or **-\-global-stacks** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
-19. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
+21. **leading_zero()**: **0** if leading zeroes are not enabled with the **-z**
or **--leading-zeroes** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
-20. **rand()**: A pseudo-random integer between **0** (inclusive) and
+22. **rand()**: A pseudo-random integer between **0** (inclusive) and
**BC_RAND_MAX** (inclusive). Using this operand will change the value of
**seed**. This is a **non-portable extension**.
-21. **irand(E)**: A pseudo-random integer between **0** (inclusive) and the
+23. **irand(E)**: A pseudo-random integer between **0** (inclusive) and the
value of **E** (exclusive). If **E** is negative or is a non-integer
(**E**'s *scale* is not **0**), an error is raised, and bc(1) resets (see
the **RESET** section) while **seed** remains unchanged. If **E** is larger
@@ -608,7 +616,7 @@ The following are valid operands in bc(1):
change the value of **seed**, unless the value of **E** is **0** or **1**.
In that case, **0** is returned, and **seed** is *not* changed. This is a
**non-portable extension**.
-22. **maxrand()**: The max integer returned by **rand()**. This is a
+24. **maxrand()**: The max integer returned by **rand()**. This is a
**non-portable extension**.
The integers generated by **rand()** and **irand(E)** are guaranteed to be as
@@ -976,6 +984,19 @@ The **if** **else** statement does the same thing as in C.
The **quit** statement causes bc(1) to quit, even if it is on a branch that will
not be executed (it is a compile-time command).
+**Warning**: The behavior of this bc(1) on **quit** is slightly different from
+other bc(1) implementations. Other bc(1) implementations will exit as soon as
+they finish parsing the line that a **quit** command is on. This bc(1) will
+execute any completed and executable statements that occur before the **quit**
+statement before exiting.
+
+In other words, for the bc(1) code below:
+
+ for (i = 0; i < 3; ++i) i; quit
+
+Other bc(1) implementations will print nothing, and this bc(1) will print **0**,
+**1**, and **2** on successive lines before exiting.
+
The **halt** statement causes bc(1) to quit, if it is executed. (Unlike **quit**
if it is on a branch of an **if** statement that is not executed, bc(1) does not
quit.)
@@ -2456,13 +2477,20 @@ at https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html . The
flags **-efghiqsvVw**, all long options, and the extensions noted above are
extensions to that specification.
+In addition, the behavior of the **quit** implements an interpretation of that
+specification that is different from all known implementations. For more
+information see the **Statements** subsection of the **SYNTAX** section.
+
Note that the specification explicitly says that bc(1) only accepts numbers that
use a period (**.**) as a radix point, regardless of the value of
**LC_NUMERIC**.
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+Before version **6.1.0**, this bc(1) had incorrect behavior for the **quit**
+statement.
+
+No other bugs are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHORS
diff --git a/manuals/bcl.3 b/manuals/bcl.3
index c1da21258a17..b81d001ce3e5 100644
--- a/manuals/bcl.3
+++ b/manuals/bcl.3
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "BCL" "3" "August 2022" "Gavin D. Howard" "Libraries Manual"
+.TH "BCL" "3" "October 2022" "Gavin D. Howard" "Libraries Manual"
.nh
.ad l
.SH NAME
diff --git a/manuals/dc/A.1 b/manuals/dc/A.1
index 4771cb655ba1..a625564b7692 100644
--- a/manuals/dc/A.1
+++ b/manuals/dc/A.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "DC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -1157,6 +1157,10 @@ The execution stack is the stack of string executions.
The number that is pushed onto the stack is exactly as many as is needed
to make dc(1) exit with the \f[B]Q\f[R] command, so the sequence
\f[B],Q\f[R] will make dc(1) exit.
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
.SS Status
.PP
These commands query status of the stack or its top value.
@@ -1183,6 +1187,24 @@ stack.
If it is a string, pushes \f[B]0\f[R].
.RE
.TP
+\f[B]u\f[R]
+Pops one value off of the stack.
+If the value is a number, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a string), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
+\f[B]t\f[R]
+Pops one value off of the stack.
+If the value is a string, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a number), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
\f[B]z\f[R]
Pushes the current depth of the stack (before execution of this command)
onto the stack.
@@ -1696,7 +1718,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
.PP
None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHOR
.PP
Gavin D.
diff --git a/manuals/dc/A.1.md b/manuals/dc/A.1.md
index 0b781da0daf5..d2de6a187ab7 100644
--- a/manuals/dc/A.1.md
+++ b/manuals/dc/A.1.md
@@ -1000,6 +1000,8 @@ will be printed with a newline after and then popped from the stack.
is exactly as many as is needed to make dc(1) exit with the **Q** command,
so the sequence **,Q** will make dc(1) exit.
+ This is a **non-portable extension**.
+
## Status
These commands query status of the stack or its top value.
@@ -1022,6 +1024,20 @@ These commands query status of the stack or its top value.
If it is a string, pushes **0**.
+**u**
+
+: Pops one value off of the stack. If the value is a number, this pushes **1**
+ onto the stack. Otherwise (if it is a string), it pushes **0**.
+
+ This is a **non-portable extension**.
+
+**t**
+
+: Pops one value off of the stack. If the value is a string, this pushes **1**
+ onto the stack. Otherwise (if it is a number), it pushes **0**.
+
+ This is a **non-portable extension**.
+
**z**
: Pushes the current depth of the stack (before execution of this command)
@@ -1501,7 +1517,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+None are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHOR
diff --git a/manuals/dc/E.1 b/manuals/dc/E.1
index 525bfe41feaa..e89e1a8544c8 100644
--- a/manuals/dc/E.1
+++ b/manuals/dc/E.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "DC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -942,6 +942,10 @@ The execution stack is the stack of string executions.
The number that is pushed onto the stack is exactly as many as is needed
to make dc(1) exit with the \f[B]Q\f[R] command, so the sequence
\f[B],Q\f[R] will make dc(1) exit.
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
.SS Status
.PP
These commands query status of the stack or its top value.
@@ -968,6 +972,24 @@ stack.
If it is a string, pushes \f[B]0\f[R].
.RE
.TP
+\f[B]u\f[R]
+Pops one value off of the stack.
+If the value is a number, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a string), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
+\f[B]t\f[R]
+Pops one value off of the stack.
+If the value is a string, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a number), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
\f[B]z\f[R]
Pushes the current depth of the stack (before execution of this command)
onto the stack.
@@ -1474,7 +1496,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
.PP
None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHOR
.PP
Gavin D.
diff --git a/manuals/dc/E.1.md b/manuals/dc/E.1.md
index ac83e63bac7d..eadf99cb7928 100644
--- a/manuals/dc/E.1.md
+++ b/manuals/dc/E.1.md
@@ -831,6 +831,8 @@ will be printed with a newline after and then popped from the stack.
is exactly as many as is needed to make dc(1) exit with the **Q** command,
so the sequence **,Q** will make dc(1) exit.
+ This is a **non-portable extension**.
+
## Status
These commands query status of the stack or its top value.
@@ -853,6 +855,20 @@ These commands query status of the stack or its top value.
If it is a string, pushes **0**.
+**u**
+
+: Pops one value off of the stack. If the value is a number, this pushes **1**
+ onto the stack. Otherwise (if it is a string), it pushes **0**.
+
+ This is a **non-portable extension**.
+
+**t**
+
+: Pops one value off of the stack. If the value is a string, this pushes **1**
+ onto the stack. Otherwise (if it is a number), it pushes **0**.
+
+ This is a **non-portable extension**.
+
**z**
: Pushes the current depth of the stack (before execution of this command)
@@ -1325,7 +1341,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+None are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHOR
diff --git a/manuals/dc/EH.1 b/manuals/dc/EH.1
index daad57d73dc6..59cfb2894c37 100644
--- a/manuals/dc/EH.1
+++ b/manuals/dc/EH.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "DC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -942,6 +942,10 @@ The execution stack is the stack of string executions.
The number that is pushed onto the stack is exactly as many as is needed
to make dc(1) exit with the \f[B]Q\f[R] command, so the sequence
\f[B],Q\f[R] will make dc(1) exit.
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
.SS Status
.PP
These commands query status of the stack or its top value.
@@ -968,6 +972,24 @@ stack.
If it is a string, pushes \f[B]0\f[R].
.RE
.TP
+\f[B]u\f[R]
+Pops one value off of the stack.
+If the value is a number, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a string), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
+\f[B]t\f[R]
+Pops one value off of the stack.
+If the value is a string, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a number), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
\f[B]z\f[R]
Pushes the current depth of the stack (before execution of this command)
onto the stack.
@@ -1448,7 +1470,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
.PP
None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHOR
.PP
Gavin D.
diff --git a/manuals/dc/EH.1.md b/manuals/dc/EH.1.md
index 8b5891f14e6e..06c2af44ac1e 100644
--- a/manuals/dc/EH.1.md
+++ b/manuals/dc/EH.1.md
@@ -831,6 +831,8 @@ will be printed with a newline after and then popped from the stack.
is exactly as many as is needed to make dc(1) exit with the **Q** command,
so the sequence **,Q** will make dc(1) exit.
+ This is a **non-portable extension**.
+
## Status
These commands query status of the stack or its top value.
@@ -853,6 +855,20 @@ These commands query status of the stack or its top value.
If it is a string, pushes **0**.
+**u**
+
+: Pops one value off of the stack. If the value is a number, this pushes **1**
+ onto the stack. Otherwise (if it is a string), it pushes **0**.
+
+ This is a **non-portable extension**.
+
+**t**
+
+: Pops one value off of the stack. If the value is a string, this pushes **1**
+ onto the stack. Otherwise (if it is a number), it pushes **0**.
+
+ This is a **non-portable extension**.
+
**z**
: Pushes the current depth of the stack (before execution of this command)
@@ -1302,7 +1318,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+None are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHOR
diff --git a/manuals/dc/EHN.1 b/manuals/dc/EHN.1
index e60d3cf47fb1..a2bc6cab0eaa 100644
--- a/manuals/dc/EHN.1
+++ b/manuals/dc/EHN.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "DC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -942,6 +942,10 @@ The execution stack is the stack of string executions.
The number that is pushed onto the stack is exactly as many as is needed
to make dc(1) exit with the \f[B]Q\f[R] command, so the sequence
\f[B],Q\f[R] will make dc(1) exit.
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
.SS Status
.PP
These commands query status of the stack or its top value.
@@ -968,6 +972,24 @@ stack.
If it is a string, pushes \f[B]0\f[R].
.RE
.TP
+\f[B]u\f[R]
+Pops one value off of the stack.
+If the value is a number, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a string), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
+\f[B]t\f[R]
+Pops one value off of the stack.
+If the value is a string, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a number), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
\f[B]z\f[R]
Pushes the current depth of the stack (before execution of this command)
onto the stack.
@@ -1444,7 +1466,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
.PP
None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHOR
.PP
Gavin D.
diff --git a/manuals/dc/EHN.1.md b/manuals/dc/EHN.1.md
index 96a020662b38..96ee28904ee2 100644
--- a/manuals/dc/EHN.1.md
+++ b/manuals/dc/EHN.1.md
@@ -831,6 +831,8 @@ will be printed with a newline after and then popped from the stack.
is exactly as many as is needed to make dc(1) exit with the **Q** command,
so the sequence **,Q** will make dc(1) exit.
+ This is a **non-portable extension**.
+
## Status
These commands query status of the stack or its top value.
@@ -853,6 +855,20 @@ These commands query status of the stack or its top value.
If it is a string, pushes **0**.
+**u**
+
+: Pops one value off of the stack. If the value is a number, this pushes **1**
+ onto the stack. Otherwise (if it is a string), it pushes **0**.
+
+ This is a **non-portable extension**.
+
+**t**
+
+: Pops one value off of the stack. If the value is a string, this pushes **1**
+ onto the stack. Otherwise (if it is a number), it pushes **0**.
+
+ This is a **non-portable extension**.
+
**z**
: Pushes the current depth of the stack (before execution of this command)
@@ -1297,7 +1313,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+None are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHOR
diff --git a/manuals/dc/EN.1 b/manuals/dc/EN.1
index a1eb86cc5096..980f0d50c13c 100644
--- a/manuals/dc/EN.1
+++ b/manuals/dc/EN.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "DC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -942,6 +942,10 @@ The execution stack is the stack of string executions.
The number that is pushed onto the stack is exactly as many as is needed
to make dc(1) exit with the \f[B]Q\f[R] command, so the sequence
\f[B],Q\f[R] will make dc(1) exit.
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
.SS Status
.PP
These commands query status of the stack or its top value.
@@ -968,6 +972,24 @@ stack.
If it is a string, pushes \f[B]0\f[R].
.RE
.TP
+\f[B]u\f[R]
+Pops one value off of the stack.
+If the value is a number, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a string), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
+\f[B]t\f[R]
+Pops one value off of the stack.
+If the value is a string, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a number), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
\f[B]z\f[R]
Pushes the current depth of the stack (before execution of this command)
onto the stack.
@@ -1470,7 +1492,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
.PP
None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHOR
.PP
Gavin D.
diff --git a/manuals/dc/EN.1.md b/manuals/dc/EN.1.md
index 357c5d250666..713cc2fcc82d 100644
--- a/manuals/dc/EN.1.md
+++ b/manuals/dc/EN.1.md
@@ -831,6 +831,8 @@ will be printed with a newline after and then popped from the stack.
is exactly as many as is needed to make dc(1) exit with the **Q** command,
so the sequence **,Q** will make dc(1) exit.
+ This is a **non-portable extension**.
+
## Status
These commands query status of the stack or its top value.
@@ -853,6 +855,20 @@ These commands query status of the stack or its top value.
If it is a string, pushes **0**.
+**u**
+
+: Pops one value off of the stack. If the value is a number, this pushes **1**
+ onto the stack. Otherwise (if it is a string), it pushes **0**.
+
+ This is a **non-portable extension**.
+
+**t**
+
+: Pops one value off of the stack. If the value is a string, this pushes **1**
+ onto the stack. Otherwise (if it is a number), it pushes **0**.
+
+ This is a **non-portable extension**.
+
**z**
: Pushes the current depth of the stack (before execution of this command)
@@ -1320,7 +1336,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+None are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHOR
diff --git a/manuals/dc/H.1 b/manuals/dc/H.1
index 7f9a18051ccf..e9934a85d4a4 100644
--- a/manuals/dc/H.1
+++ b/manuals/dc/H.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "DC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -1157,6 +1157,10 @@ The execution stack is the stack of string executions.
The number that is pushed onto the stack is exactly as many as is needed
to make dc(1) exit with the \f[B]Q\f[R] command, so the sequence
\f[B],Q\f[R] will make dc(1) exit.
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
.SS Status
.PP
These commands query status of the stack or its top value.
@@ -1183,6 +1187,24 @@ stack.
If it is a string, pushes \f[B]0\f[R].
.RE
.TP
+\f[B]u\f[R]
+Pops one value off of the stack.
+If the value is a number, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a string), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
+\f[B]t\f[R]
+Pops one value off of the stack.
+If the value is a string, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a number), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
\f[B]z\f[R]
Pushes the current depth of the stack (before execution of this command)
onto the stack.
@@ -1670,7 +1692,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
.PP
None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHOR
.PP
Gavin D.
diff --git a/manuals/dc/H.1.md b/manuals/dc/H.1.md
index feab8309b693..55cc7cbe3005 100644
--- a/manuals/dc/H.1.md
+++ b/manuals/dc/H.1.md
@@ -1000,6 +1000,8 @@ will be printed with a newline after and then popped from the stack.
is exactly as many as is needed to make dc(1) exit with the **Q** command,
so the sequence **,Q** will make dc(1) exit.
+ This is a **non-portable extension**.
+
## Status
These commands query status of the stack or its top value.
@@ -1022,6 +1024,20 @@ These commands query status of the stack or its top value.
If it is a string, pushes **0**.
+**u**
+
+: Pops one value off of the stack. If the value is a number, this pushes **1**
+ onto the stack. Otherwise (if it is a string), it pushes **0**.
+
+ This is a **non-portable extension**.
+
+**t**
+
+: Pops one value off of the stack. If the value is a string, this pushes **1**
+ onto the stack. Otherwise (if it is a number), it pushes **0**.
+
+ This is a **non-portable extension**.
+
**z**
: Pushes the current depth of the stack (before execution of this command)
@@ -1478,7 +1494,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+None are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHOR
diff --git a/manuals/dc/HN.1 b/manuals/dc/HN.1
index 0c5db06234b7..d22b159db067 100644
--- a/manuals/dc/HN.1
+++ b/manuals/dc/HN.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "DC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -1157,6 +1157,10 @@ The execution stack is the stack of string executions.
The number that is pushed onto the stack is exactly as many as is needed
to make dc(1) exit with the \f[B]Q\f[R] command, so the sequence
\f[B],Q\f[R] will make dc(1) exit.
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
.SS Status
.PP
These commands query status of the stack or its top value.
@@ -1183,6 +1187,24 @@ stack.
If it is a string, pushes \f[B]0\f[R].
.RE
.TP
+\f[B]u\f[R]
+Pops one value off of the stack.
+If the value is a number, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a string), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
+\f[B]t\f[R]
+Pops one value off of the stack.
+If the value is a string, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a number), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
\f[B]z\f[R]
Pushes the current depth of the stack (before execution of this command)
onto the stack.
@@ -1666,7 +1688,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
.PP
None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHOR
.PP
Gavin D.
diff --git a/manuals/dc/HN.1.md b/manuals/dc/HN.1.md
index 81badc9edb67..c9c980996234 100644
--- a/manuals/dc/HN.1.md
+++ b/manuals/dc/HN.1.md
@@ -1000,6 +1000,8 @@ will be printed with a newline after and then popped from the stack.
is exactly as many as is needed to make dc(1) exit with the **Q** command,
so the sequence **,Q** will make dc(1) exit.
+ This is a **non-portable extension**.
+
## Status
These commands query status of the stack or its top value.
@@ -1022,6 +1024,20 @@ These commands query status of the stack or its top value.
If it is a string, pushes **0**.
+**u**
+
+: Pops one value off of the stack. If the value is a number, this pushes **1**
+ onto the stack. Otherwise (if it is a string), it pushes **0**.
+
+ This is a **non-portable extension**.
+
+**t**
+
+: Pops one value off of the stack. If the value is a string, this pushes **1**
+ onto the stack. Otherwise (if it is a number), it pushes **0**.
+
+ This is a **non-portable extension**.
+
**z**
: Pushes the current depth of the stack (before execution of this command)
@@ -1473,7 +1489,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+None are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHOR
diff --git a/manuals/dc/N.1 b/manuals/dc/N.1
index b3e13537e6a8..9988fe063750 100644
--- a/manuals/dc/N.1
+++ b/manuals/dc/N.1
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.TH "DC" "1" "August 2022" "Gavin D. Howard" "General Commands Manual"
+.TH "DC" "1" "October 2022" "Gavin D. Howard" "General Commands Manual"
.nh
.ad l
.SH Name
@@ -1157,6 +1157,10 @@ The execution stack is the stack of string executions.
The number that is pushed onto the stack is exactly as many as is needed
to make dc(1) exit with the \f[B]Q\f[R] command, so the sequence
\f[B],Q\f[R] will make dc(1) exit.
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
.SS Status
.PP
These commands query status of the stack or its top value.
@@ -1183,6 +1187,24 @@ stack.
If it is a string, pushes \f[B]0\f[R].
.RE
.TP
+\f[B]u\f[R]
+Pops one value off of the stack.
+If the value is a number, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a string), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
+\f[B]t\f[R]
+Pops one value off of the stack.
+If the value is a string, this pushes \f[B]1\f[R] onto the stack.
+Otherwise (if it is a number), it pushes \f[B]0\f[R].
+.RS
+.PP
+This is a \f[B]non-portable extension\f[R].
+.RE
+.TP
\f[B]z\f[R]
Pushes the current depth of the stack (before execution of this command)
onto the stack.
@@ -1692,7 +1714,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
.SH BUGS
.PP
None are known.
-Report bugs at https://git.yzena.com/gavin/bc.
+Report bugs at https://git.yzena.com/gavin/bc .
.SH AUTHOR
.PP
Gavin D.
diff --git a/manuals/dc/N.1.md b/manuals/dc/N.1.md
index 694a0cb907e8..52ffa0b23cfa 100644
--- a/manuals/dc/N.1.md
+++ b/manuals/dc/N.1.md
@@ -1000,6 +1000,8 @@ will be printed with a newline after and then popped from the stack.
is exactly as many as is needed to make dc(1) exit with the **Q** command,
so the sequence **,Q** will make dc(1) exit.
+ This is a **non-portable extension**.
+
## Status
These commands query status of the stack or its top value.
@@ -1022,6 +1024,20 @@ These commands query status of the stack or its top value.
If it is a string, pushes **0**.
+**u**
+
+: Pops one value off of the stack. If the value is a number, this pushes **1**
+ onto the stack. Otherwise (if it is a string), it pushes **0**.
+
+ This is a **non-portable extension**.
+
+**t**
+
+: Pops one value off of the stack. If the value is a string, this pushes **1**
+ onto the stack. Otherwise (if it is a number), it pushes **0**.
+
+ This is a **non-portable extension**.
+
**z**
: Pushes the current depth of the stack (before execution of this command)
@@ -1496,7 +1512,7 @@ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html .
# BUGS
-None are known. Report bugs at https://git.yzena.com/gavin/bc.
+None are known. Report bugs at https://git.yzena.com/gavin/bc .
# AUTHOR