Browse Source

Update documentation for the new features

Signed-off-by: Gavin Howard <gavin@yzena.com>
line_libs
Gavin Howard 11 months ago
parent
commit
b120cd3dd6
Signed by: gavin
GPG Key ID: C08038BDF280D33E
  1. 10
      gen/bc_help.txt
  2. 10
      gen/dc_help.txt
  3. 68
      manuals/bc.1.md.in
  4. 89
      manuals/bc/A.1
  5. 68
      manuals/bc/A.1.md
  6. 45
      manuals/bc/E.1
  7. 30
      manuals/bc/E.1.md
  8. 45
      manuals/bc/EH.1
  9. 30
      manuals/bc/EH.1.md
  10. 45
      manuals/bc/EHN.1
  11. 30
      manuals/bc/EHN.1.md
  12. 45
      manuals/bc/EN.1
  13. 30
      manuals/bc/EN.1.md
  14. 89
      manuals/bc/H.1
  15. 68
      manuals/bc/H.1.md
  16. 89
      manuals/bc/HN.1
  17. 68
      manuals/bc/HN.1.md
  18. 89
      manuals/bc/N.1
  19. 68
      manuals/bc/N.1.md
  20. 40
      manuals/dc.1.md.in
  21. 45
      manuals/dc/A.1
  22. 40
      manuals/dc/A.1.md
  23. 45
      manuals/dc/E.1
  24. 40
      manuals/dc/E.1.md
  25. 45
      manuals/dc/EH.1
  26. 40
      manuals/dc/EH.1.md
  27. 45
      manuals/dc/EHN.1
  28. 40
      manuals/dc/EHN.1.md
  29. 45
      manuals/dc/EN.1
  30. 40
      manuals/dc/EN.1.md
  31. 45
      manuals/dc/H.1
  32. 40
      manuals/dc/H.1.md
  33. 45
      manuals/dc/HN.1
  34. 40
      manuals/dc/HN.1.md
  35. 45
      manuals/dc/N.1
  36. 40
      manuals/dc/N.1.md

10
gen/bc_help.txt

@ -86,6 +86,10 @@ Options:
Force interactive mode.
-L --no-line-length
Disable line length checking.
-l --mathlib
Use predefined math routines:
@ -135,6 +139,10 @@ Options:
Print version information and copyright and exit.
-z --leading-zeroes
Enable leading zeroes on numbers greater than -1 and less than 1.
Environment variables:
POSIXLY_CORRECT
@ -148,7 +156,7 @@ Environment variables:
BC_LINE_LENGTH
If an integer, the number of characters to print on a line before
wrapping.
wrapping. Using 0 will disable line length checking.
BC_BANNER

10
gen/dc_help.txt

@ -89,6 +89,10 @@ Options:
Put dc into interactive mode. See the man page for more details.
-L --no-line-length
Disable line length checking.
-P --no-prompt
Disable the prompts in interactive mode.
@ -105,6 +109,10 @@ Options:
Enable extended register mode.
-z --leading-zeroes
Enable leading zeroes on numbers greater than -1 and less than 1.
Environment variables:
DC_ENV_ARGS
@ -114,7 +122,7 @@ Environment variables:
DC_LINE_LENGTH
If an integer, the number of characters to print on a line before
wrapping.
wrapping. Using 0 will disable line length checking.
DC_SIGINT_RESET

68
manuals/bc.1.md.in

@ -170,6 +170,14 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-L**, **-\-no-line-length**
: Disables line length checking and prints numbers without backslashes and
newlines. In other words, this option sets **BC_LINE_LENGTH** to **0** (see
the **ENVIRONMENT VARIABLES** section).
This is a **non-portable extension**.
**-l**, **-\-mathlib**
: Sets **scale** (see the **SYNTAX** section) to **20** and loads the included
@ -293,6 +301,17 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-z**, **-\-leading-zeroes**
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
This can be set for individual numbers with the **plz(x)**, plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
This is a **non-portable extension**.
**-e** *expr*, **-\-expression**=*expr*
: Evaluates *expr*. If multiple expressions are given, they are evaluated in
@ -546,11 +565,19 @@ The following are valid operands in bc(1):
extension**.
16. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
17. **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**
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**
or **--leading-zeroes** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
{{ A H N HN }}
17. **rand()**: A pseudo-random integer between **0** (inclusive) and
20. **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**.
18. **irand(E)**: A pseudo-random integer between **0** (inclusive) and the
21. **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
@ -561,7 +588,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**.
19. **maxrand()**: The max integer returned by **rand()**. This is a
22. **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
@ -1686,6 +1713,38 @@ The extended library is a **non-portable extension**.
This function is used to implement other bitwise functions; it is not meant
to be used by users, but it can be.
**plz(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
it is printed with a leading zero, regardless of the use of the **-z**
option (see the **OPTIONS** section) and without a trailing newline.
Otherwise, **x** is printed normally, without a trailing newline.
**plznl(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
it is printed with a leading zero, regardless of the use of the **-z**
option (see the **OPTIONS** section) and with a trailing newline.
Otherwise, **x** is printed normally, with a trailing newline.
**pnlz(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
it is printed without a leading zero, regardless of the use of the **-z**
option (see the **OPTIONS** section) and without a trailing newline.
Otherwise, **x** is printed normally, without a trailing newline.
**pnlznl(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
it is printed without a leading zero, regardless of the use of the **-z**
option (see the **OPTIONS** section) and with a trailing newline.
Otherwise, **x** is printed normally, with a trailing newline.
**ubytes(x)**
: Returns the numbers of unsigned integer bytes required to hold the truncated
@ -2106,6 +2165,9 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
The special value of **0** will disable line length checking and print
numbers without regard to line length and without backslashes and newlines.
**BC_BANNER**
: If this environment variable exists and contains an integer, then a non-zero

89
manuals/bc/A.1

@ -176,6 +176,16 @@ Forces interactive mode.
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-L\f[R], \f[B]--no-line-length\f[R]
Disables line length checking and prints numbers without backslashes and
newlines.
In other words, this option sets \f[B]BC_LINE_LENGTH\f[R] to \f[B]0\f[R]
(see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
.RS
.PP
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-l\f[R], \f[B]--mathlib\f[R]
Sets \f[B]scale\f[R] (see the \f[B]SYNTAX\f[R] section) to \f[B]20\f[R]
and loads the included math library and the extended math library before
@ -318,6 +328,18 @@ continues normally.
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-z\f[R], \f[B]--leading-zeroes\f[R]
Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-e\f[R] \f[I]expr\f[R], \f[B]--expression\f[R]=\f[I]expr\f[R]
Evaluates \f[I]expr\f[R].
If multiple expressions are given, they are evaluated in order.
@ -636,11 +658,28 @@ This is a \f[B]non-portable extension\f[R].
\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
\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
\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
\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
\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 "18." 4
.IP "21." 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
@ -658,7 +697,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 "19." 4
.IP "22." 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
@ -1937,6 +1976,46 @@ This function is used to implement other bitwise functions; it is not
meant to be used by users, but it can be.
.RE
.TP
\f[B]plz(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that \f[B]-1\f[R]
and less than \f[B]1\f[R], it is printed with a leading zero, regardless
of the use of the \f[B]-z\f[R] option (see the \f[B]OPTIONS\f[R]
section) and without a trailing newline.
.RS
.PP
Otherwise, \f[B]x\f[R] is printed normally, without a trailing newline.
.RE
.TP
\f[B]plznl(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that \f[B]-1\f[R]
and less than \f[B]1\f[R], it is printed with a leading zero, regardless
of the use of the \f[B]-z\f[R] option (see the \f[B]OPTIONS\f[R]
section) and with a trailing newline.
.RS
.PP
Otherwise, \f[B]x\f[R] is printed normally, with a trailing newline.
.RE
.TP
\f[B]pnlz(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that \f[B]-1\f[R]
and less than \f[B]1\f[R], it is printed without a leading zero,
regardless of the use of the \f[B]-z\f[R] option (see the
\f[B]OPTIONS\f[R] section) and without a trailing newline.
.RS
.PP
Otherwise, \f[B]x\f[R] is printed normally, without a trailing newline.
.RE
.TP
\f[B]pnlznl(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that \f[B]-1\f[R]
and less than \f[B]1\f[R], it is printed without a leading zero,
regardless of the use of the \f[B]-z\f[R] option (see the
\f[B]OPTIONS\f[R] section) and with a trailing newline.
.RS
.PP
Otherwise, \f[B]x\f[R] is printed normally, with a trailing newline.
.RE
.TP
\f[B]ubytes(x)\f[R]
Returns the numbers of unsigned integer bytes required to hold the
truncated absolute value of \f[B]x\f[R].
@ -2407,6 +2486,12 @@ greater than \f[B]1\f[R] and is less than \f[B]UINT16_MAX\f[R]
(\f[B]2\[ha]16-1\f[R]), bc(1) will output lines to that length,
including the backslash (\f[B]\[rs]\f[R]).
The default line length is \f[B]70\f[R].
.RS
.PP
The special value of \f[B]0\f[R] will disable line length checking and
print numbers without regard to line length and without backslashes and
newlines.
.RE
.TP
\f[B]BC_BANNER\f[R]
If this environment variable exists and contains an integer, then a

68
manuals/bc/A.1.md

@ -141,6 +141,14 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-L**, **-\-no-line-length**
: Disables line length checking and prints numbers without backslashes and
newlines. In other words, this option sets **BC_LINE_LENGTH** to **0** (see
the **ENVIRONMENT VARIABLES** section).
This is a **non-portable extension**.
**-l**, **-\-mathlib**
: Sets **scale** (see the **SYNTAX** section) to **20** and loads the included
@ -248,6 +256,17 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-z**, **-\-leading-zeroes**
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
This can be set for individual numbers with the **plz(x)**, plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
This is a **non-portable extension**.
**-e** *expr*, **-\-expression**=*expr*
: Evaluates *expr*. If multiple expressions are given, they are evaluated in
@ -488,10 +507,18 @@ The following are valid operands in bc(1):
extension**.
16. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
17. **rand()**: A pseudo-random integer between **0** (inclusive) and
17. **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**
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**
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
**BC_RAND_MAX** (inclusive). Using this operand will change the value of
**seed**. This is a **non-portable extension**.
18. **irand(E)**: A pseudo-random integer between **0** (inclusive) and the
21. **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
@ -502,7 +529,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**.
19. **maxrand()**: The max integer returned by **rand()**. This is a
22. **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
@ -1597,6 +1624,38 @@ The extended library is a **non-portable extension**.
This function is used to implement other bitwise functions; it is not meant
to be used by users, but it can be.
**plz(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
it is printed with a leading zero, regardless of the use of the **-z**
option (see the **OPTIONS** section) and without a trailing newline.
Otherwise, **x** is printed normally, without a trailing newline.
**plznl(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
it is printed with a leading zero, regardless of the use of the **-z**
option (see the **OPTIONS** section) and with a trailing newline.
Otherwise, **x** is printed normally, with a trailing newline.
**pnlz(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
it is printed without a leading zero, regardless of the use of the **-z**
option (see the **OPTIONS** section) and without a trailing newline.
Otherwise, **x** is printed normally, without a trailing newline.
**pnlznl(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
it is printed without a leading zero, regardless of the use of the **-z**
option (see the **OPTIONS** section) and with a trailing newline.
Otherwise, **x** is printed normally, with a trailing newline.
**ubytes(x)**
: Returns the numbers of unsigned integer bytes required to hold the truncated
@ -2012,6 +2071,9 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
The special value of **0** will disable line length checking and print
numbers without regard to line length and without backslashes and newlines.
**BC_BANNER**
: If this environment variable exists and contains an integer, then a non-zero

45
manuals/bc/E.1

@ -154,6 +154,16 @@ Forces interactive mode.
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-L\f[R], \f[B]--no-line-length\f[R]
Disables line length checking and prints numbers without backslashes and
newlines.
In other words, this option sets \f[B]BC_LINE_LENGTH\f[R] to \f[B]0\f[R]
(see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
.RS
.PP
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-l\f[R], \f[B]--mathlib\f[R]
Sets \f[B]scale\f[R] (see the \f[B]SYNTAX\f[R] section) to \f[B]20\f[R]
and loads the included math library before running any code, including
@ -287,6 +297,18 @@ continues normally.
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-z\f[R], \f[B]--leading-zeroes\f[R]
Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-e\f[R] \f[I]expr\f[R], \f[B]--expression\f[R]=\f[I]expr\f[R]
Evaluates \f[I]expr\f[R].
If multiple expressions are given, they are evaluated in order.
@ -570,6 +592,23 @@ This is a \f[B]non-portable extension\f[R].
.IP "16." 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
\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
\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
\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].
.SS Numbers
.PP
Numbers are strings made up of digits, uppercase letters, and at most
@ -1295,6 +1334,12 @@ greater than \f[B]1\f[R] and is less than \f[B]UINT16_MAX\f[R]
(\f[B]2\[ha]16-1\f[R]), bc(1) will output lines to that length,
including the backslash (\f[B]\[rs]\f[R]).
The default line length is \f[B]70\f[R].
.RS
.PP
The special value of \f[B]0\f[R] will disable line length checking and
print numbers without regard to line length and without backslashes and
newlines.
.RE
.TP
\f[B]BC_BANNER\f[R]
If this environment variable exists and contains an integer, then a

30
manuals/bc/E.1.md

@ -125,6 +125,14 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-L**, **-\-no-line-length**
: Disables line length checking and prints numbers without backslashes and
newlines. In other words, this option sets **BC_LINE_LENGTH** to **0** (see
the **ENVIRONMENT VARIABLES** section).
This is a **non-portable extension**.
**-l**, **-\-mathlib**
: Sets **scale** (see the **SYNTAX** section) to **20** and loads the included
@ -228,6 +236,17 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-z**, **-\-leading-zeroes**
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
This can be set for individual numbers with the **plz(x)**, plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
This is a **non-portable extension**.
**-e** *expr*, **-\-expression**=*expr*
: Evaluates *expr*. If multiple expressions are given, they are evaluated in
@ -442,6 +461,14 @@ The following are valid operands in bc(1):
extension**.
16. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
17. **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**
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**
or **--leading-zeroes** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
## Numbers
@ -1064,6 +1091,9 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
The special value of **0** will disable line length checking and print
numbers without regard to line length and without backslashes and newlines.
**BC_BANNER**
: If this environment variable exists and contains an integer, then a non-zero

45
manuals/bc/EH.1

@ -154,6 +154,16 @@ Forces interactive mode.
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-L\f[R], \f[B]--no-line-length\f[R]
Disables line length checking and prints numbers without backslashes and
newlines.
In other words, this option sets \f[B]BC_LINE_LENGTH\f[R] to \f[B]0\f[R]
(see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
.RS
.PP
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-l\f[R], \f[B]--mathlib\f[R]
Sets \f[B]scale\f[R] (see the \f[B]SYNTAX\f[R] section) to \f[B]20\f[R]
and loads the included math library before running any code, including
@ -287,6 +297,18 @@ continues normally.
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-z\f[R], \f[B]--leading-zeroes\f[R]
Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-e\f[R] \f[I]expr\f[R], \f[B]--expression\f[R]=\f[I]expr\f[R]
Evaluates \f[I]expr\f[R].
If multiple expressions are given, they are evaluated in order.
@ -570,6 +592,23 @@ This is a \f[B]non-portable extension\f[R].
.IP "16." 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
\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
\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
\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].
.SS Numbers
.PP
Numbers are strings made up of digits, uppercase letters, and at most
@ -1295,6 +1334,12 @@ greater than \f[B]1\f[R] and is less than \f[B]UINT16_MAX\f[R]
(\f[B]2\[ha]16-1\f[R]), bc(1) will output lines to that length,
including the backslash (\f[B]\[rs]\f[R]).
The default line length is \f[B]70\f[R].
.RS
.PP
The special value of \f[B]0\f[R] will disable line length checking and
print numbers without regard to line length and without backslashes and
newlines.
.RE
.TP
\f[B]BC_BANNER\f[R]
If this environment variable exists and contains an integer, then a

30
manuals/bc/EH.1.md

@ -125,6 +125,14 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-L**, **-\-no-line-length**
: Disables line length checking and prints numbers without backslashes and
newlines. In other words, this option sets **BC_LINE_LENGTH** to **0** (see
the **ENVIRONMENT VARIABLES** section).
This is a **non-portable extension**.
**-l**, **-\-mathlib**
: Sets **scale** (see the **SYNTAX** section) to **20** and loads the included
@ -228,6 +236,17 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-z**, **-\-leading-zeroes**
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
This can be set for individual numbers with the **plz(x)**, plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
This is a **non-portable extension**.
**-e** *expr*, **-\-expression**=*expr*
: Evaluates *expr*. If multiple expressions are given, they are evaluated in
@ -442,6 +461,14 @@ The following are valid operands in bc(1):
extension**.
16. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
17. **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**
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**
or **--leading-zeroes** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
## Numbers
@ -1064,6 +1091,9 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
The special value of **0** will disable line length checking and print
numbers without regard to line length and without backslashes and newlines.
**BC_BANNER**
: If this environment variable exists and contains an integer, then a non-zero

45
manuals/bc/EHN.1

@ -154,6 +154,16 @@ Forces interactive mode.
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-L\f[R], \f[B]--no-line-length\f[R]
Disables line length checking and prints numbers without backslashes and
newlines.
In other words, this option sets \f[B]BC_LINE_LENGTH\f[R] to \f[B]0\f[R]
(see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
.RS
.PP
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-l\f[R], \f[B]--mathlib\f[R]
Sets \f[B]scale\f[R] (see the \f[B]SYNTAX\f[R] section) to \f[B]20\f[R]
and loads the included math library before running any code, including
@ -287,6 +297,18 @@ continues normally.
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-z\f[R], \f[B]--leading-zeroes\f[R]
Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-e\f[R] \f[I]expr\f[R], \f[B]--expression\f[R]=\f[I]expr\f[R]
Evaluates \f[I]expr\f[R].
If multiple expressions are given, they are evaluated in order.
@ -570,6 +592,23 @@ This is a \f[B]non-portable extension\f[R].
.IP "16." 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
\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
\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
\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].
.SS Numbers
.PP
Numbers are strings made up of digits, uppercase letters, and at most
@ -1295,6 +1334,12 @@ greater than \f[B]1\f[R] and is less than \f[B]UINT16_MAX\f[R]
(\f[B]2\[ha]16-1\f[R]), bc(1) will output lines to that length,
including the backslash (\f[B]\[rs]\f[R]).
The default line length is \f[B]70\f[R].
.RS
.PP
The special value of \f[B]0\f[R] will disable line length checking and
print numbers without regard to line length and without backslashes and
newlines.
.RE
.TP
\f[B]BC_BANNER\f[R]
If this environment variable exists and contains an integer, then a

30
manuals/bc/EHN.1.md

@ -125,6 +125,14 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-L**, **-\-no-line-length**
: Disables line length checking and prints numbers without backslashes and
newlines. In other words, this option sets **BC_LINE_LENGTH** to **0** (see
the **ENVIRONMENT VARIABLES** section).
This is a **non-portable extension**.
**-l**, **-\-mathlib**
: Sets **scale** (see the **SYNTAX** section) to **20** and loads the included
@ -228,6 +236,17 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-z**, **-\-leading-zeroes**
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
This can be set for individual numbers with the **plz(x)**, plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
This is a **non-portable extension**.
**-e** *expr*, **-\-expression**=*expr*
: Evaluates *expr*. If multiple expressions are given, they are evaluated in
@ -442,6 +461,14 @@ The following are valid operands in bc(1):
extension**.
16. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
17. **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**
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**
or **--leading-zeroes** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
## Numbers
@ -1064,6 +1091,9 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
The special value of **0** will disable line length checking and print
numbers without regard to line length and without backslashes and newlines.
**BC_BANNER**
: If this environment variable exists and contains an integer, then a non-zero

45
manuals/bc/EN.1

@ -154,6 +154,16 @@ Forces interactive mode.
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-L\f[R], \f[B]--no-line-length\f[R]
Disables line length checking and prints numbers without backslashes and
newlines.
In other words, this option sets \f[B]BC_LINE_LENGTH\f[R] to \f[B]0\f[R]
(see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
.RS
.PP
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-l\f[R], \f[B]--mathlib\f[R]
Sets \f[B]scale\f[R] (see the \f[B]SYNTAX\f[R] section) to \f[B]20\f[R]
and loads the included math library before running any code, including
@ -287,6 +297,18 @@ continues normally.
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-z\f[R], \f[B]--leading-zeroes\f[R]
Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-e\f[R] \f[I]expr\f[R], \f[B]--expression\f[R]=\f[I]expr\f[R]
Evaluates \f[I]expr\f[R].
If multiple expressions are given, they are evaluated in order.
@ -570,6 +592,23 @@ This is a \f[B]non-portable extension\f[R].
.IP "16." 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
\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
\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
\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].
.SS Numbers
.PP
Numbers are strings made up of digits, uppercase letters, and at most
@ -1295,6 +1334,12 @@ greater than \f[B]1\f[R] and is less than \f[B]UINT16_MAX\f[R]
(\f[B]2\[ha]16-1\f[R]), bc(1) will output lines to that length,
including the backslash (\f[B]\[rs]\f[R]).
The default line length is \f[B]70\f[R].
.RS
.PP
The special value of \f[B]0\f[R] will disable line length checking and
print numbers without regard to line length and without backslashes and
newlines.
.RE
.TP
\f[B]BC_BANNER\f[R]
If this environment variable exists and contains an integer, then a

30
manuals/bc/EN.1.md

@ -125,6 +125,14 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-L**, **-\-no-line-length**
: Disables line length checking and prints numbers without backslashes and
newlines. In other words, this option sets **BC_LINE_LENGTH** to **0** (see
the **ENVIRONMENT VARIABLES** section).
This is a **non-portable extension**.
**-l**, **-\-mathlib**
: Sets **scale** (see the **SYNTAX** section) to **20** and loads the included
@ -228,6 +236,17 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-z**, **-\-leading-zeroes**
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
This can be set for individual numbers with the **plz(x)**, plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
This is a **non-portable extension**.
**-e** *expr*, **-\-expression**=*expr*
: Evaluates *expr*. If multiple expressions are given, they are evaluated in
@ -442,6 +461,14 @@ The following are valid operands in bc(1):
extension**.
16. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
17. **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**
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**
or **--leading-zeroes** options, non-zero otherwise. See the **OPTIONS**
section. This is a **non-portable extension**.
## Numbers
@ -1064,6 +1091,9 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
The special value of **0** will disable line length checking and print
numbers without regard to line length and without backslashes and newlines.
**BC_BANNER**
: If this environment variable exists and contains an integer, then a non-zero

89
manuals/bc/H.1

@ -176,6 +176,16 @@ Forces interactive mode.
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-L\f[R], \f[B]--no-line-length\f[R]
Disables line length checking and prints numbers without backslashes and
newlines.
In other words, this option sets \f[B]BC_LINE_LENGTH\f[R] to \f[B]0\f[R]
(see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
.RS
.PP
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-l\f[R], \f[B]--mathlib\f[R]
Sets \f[B]scale\f[R] (see the \f[B]SYNTAX\f[R] section) to \f[B]20\f[R]
and loads the included math library and the extended math library before
@ -318,6 +328,18 @@ continues normally.
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-z\f[R], \f[B]--leading-zeroes\f[R]
Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-e\f[R] \f[I]expr\f[R], \f[B]--expression\f[R]=\f[I]expr\f[R]
Evaluates \f[I]expr\f[R].
If multiple expressions are given, they are evaluated in order.
@ -636,11 +658,28 @@ This is a \f[B]non-portable extension\f[R].
\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
\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
\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
\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
\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 "18." 4
.IP "21." 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
@ -658,7 +697,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 "19." 4
.IP "22." 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
@ -1937,6 +1976,46 @@ This function is used to implement other bitwise functions; it is not
meant to be used by users, but it can be.
.RE
.TP
\f[B]plz(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that \f[B]-1\f[R]
and less than \f[B]1\f[R], it is printed with a leading zero, regardless
of the use of the \f[B]-z\f[R] option (see the \f[B]OPTIONS\f[R]
section) and without a trailing newline.
.RS
.PP
Otherwise, \f[B]x\f[R] is printed normally, without a trailing newline.
.RE
.TP
\f[B]plznl(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that \f[B]-1\f[R]
and less than \f[B]1\f[R], it is printed with a leading zero, regardless
of the use of the \f[B]-z\f[R] option (see the \f[B]OPTIONS\f[R]
section) and with a trailing newline.
.RS
.PP
Otherwise, \f[B]x\f[R] is printed normally, with a trailing newline.
.RE
.TP
\f[B]pnlz(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that \f[B]-1\f[R]
and less than \f[B]1\f[R], it is printed without a leading zero,
regardless of the use of the \f[B]-z\f[R] option (see the
\f[B]OPTIONS\f[R] section) and without a trailing newline.
.RS
.PP
Otherwise, \f[B]x\f[R] is printed normally, without a trailing newline.
.RE
.TP
\f[B]pnlznl(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that \f[B]-1\f[R]
and less than \f[B]1\f[R], it is printed without a leading zero,
regardless of the use of the \f[B]-z\f[R] option (see the
\f[B]OPTIONS\f[R] section) and with a trailing newline.
.RS
.PP
Otherwise, \f[B]x\f[R] is printed normally, with a trailing newline.
.RE
.TP
\f[B]ubytes(x)\f[R]
Returns the numbers of unsigned integer bytes required to hold the
truncated absolute value of \f[B]x\f[R].
@ -2407,6 +2486,12 @@ greater than \f[B]1\f[R] and is less than \f[B]UINT16_MAX\f[R]
(\f[B]2\[ha]16-1\f[R]), bc(1) will output lines to that length,
including the backslash (\f[B]\[rs]\f[R]).
The default line length is \f[B]70\f[R].
.RS
.PP
The special value of \f[B]0\f[R] will disable line length checking and
print numbers without regard to line length and without backslashes and
newlines.
.RE
.TP
\f[B]BC_BANNER\f[R]
If this environment variable exists and contains an integer, then a

68
manuals/bc/H.1.md

@ -141,6 +141,14 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-L**, **-\-no-line-length**
: Disables line length checking and prints numbers without backslashes and
newlines. In other words, this option sets **BC_LINE_LENGTH** to **0** (see
the **ENVIRONMENT VARIABLES** section).
This is a **non-portable extension**.
**-l**, **-\-mathlib**
: Sets **scale** (see the **SYNTAX** section) to **20** and loads the included
@ -248,6 +256,17 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-z**, **-\-leading-zeroes**
: Makes bc(1) print all numbers greater than **-1** and less than **1**, and
not equal to **0**, with a leading zero.
This can be set for individual numbers with the **plz(x)**, plznl(x)**,
**pnlz(x)**, and **pnlznl(x)** functions in the extended math library (see
the **LIBRARY** section).
This is a **non-portable extension**.
**-e** *expr*, **-\-expression**=*expr*
: Evaluates *expr*. If multiple expressions are given, they are evaluated in
@ -488,10 +507,18 @@ The following are valid operands in bc(1):
extension**.
16. **maxscale()**: The max allowable **scale**. This is a **non-portable
extension**.
17. **rand()**: A pseudo-random integer between **0** (inclusive) and
17. **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**
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**
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
**BC_RAND_MAX** (inclusive). Using this operand will change the value of
**seed**. This is a **non-portable extension**.
18. **irand(E)**: A pseudo-random integer between **0** (inclusive) and the
21. **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
@ -502,7 +529,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**.
19. **maxrand()**: The max integer returned by **rand()**. This is a
22. **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
@ -1597,6 +1624,38 @@ The extended library is a **non-portable extension**.
This function is used to implement other bitwise functions; it is not meant
to be used by users, but it can be.
**plz(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
it is printed with a leading zero, regardless of the use of the **-z**
option (see the **OPTIONS** section) and without a trailing newline.
Otherwise, **x** is printed normally, without a trailing newline.
**plznl(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
it is printed with a leading zero, regardless of the use of the **-z**
option (see the **OPTIONS** section) and with a trailing newline.
Otherwise, **x** is printed normally, with a trailing newline.
**pnlz(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
it is printed without a leading zero, regardless of the use of the **-z**
option (see the **OPTIONS** section) and without a trailing newline.
Otherwise, **x** is printed normally, without a trailing newline.
**pnlznl(x)**
: If **x** is not equal to **0** and greater that **-1** and less than **1**,
it is printed without a leading zero, regardless of the use of the **-z**
option (see the **OPTIONS** section) and with a trailing newline.
Otherwise, **x** is printed normally, with a trailing newline.
**ubytes(x)**
: Returns the numbers of unsigned integer bytes required to hold the truncated
@ -2012,6 +2071,9 @@ bc(1) recognizes the following environment variables:
lines to that length, including the backslash (**\\**). The default line
length is **70**.
The special value of **0** will disable line length checking and print
numbers without regard to line length and without backslashes and newlines.
**BC_BANNER**
: If this environment variable exists and contains an integer, then a non-zero

89
manuals/bc/HN.1

@ -176,6 +176,16 @@ Forces interactive mode.
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-L\f[R], \f[B]--no-line-length\f[R]
Disables line length checking and prints numbers without backslashes and
newlines.
In other words, this option sets \f[B]BC_LINE_LENGTH\f[R] to \f[B]0\f[R]
(see the \f[B]ENVIRONMENT VARIABLES\f[R] section).
.RS
.PP
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-l\f[R], \f[B]--mathlib\f[R]
Sets \f[B]scale\f[R] (see the \f[B]SYNTAX\f[R] section) to \f[B]20\f[R]
and loads the included math library and the extended math library before
@ -318,6 +328,18 @@ continues normally.
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-z\f[R], \f[B]--leading-zeroes\f[R]
Makes bc(1) print all numbers greater than \f[B]-1\f[R] and less than
\f[B]1\f[R], and not equal to \f[B]0\f[R], with a leading zero.
.RS
.PP
This can be set for individual numbers with the \f[B]plz(x)\f[R],
plznl(x)**, \f[B]pnlz(x)\f[R], and \f[B]pnlznl(x)\f[R] functions in the
extended math library (see the \f[B]LIBRARY\f[R] section).
.PP
This is a \f[B]non-portable extension\f[R].
.RE
.TP
\f[B]-e\f[R] \f[I]expr\f[R], \f[B]--expression\f[R]=\f[I]expr\f[R]
Evaluates \f[I]expr\f[R].
If multiple expressions are given, they are evaluated in order.
@ -636,11 +658,28 @@ This is a \f[B]non-portable extension\f[R].
\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
\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
\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
\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
\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 "18." 4
.IP "21." 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
@ -658,7 +697,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 "19." 4
.IP "22." 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
@ -1937,6 +1976,46 @@ This function is used to implement other bitwise functions; it is not
meant to be used by users, but it can be.
.RE
.TP
\f[B]plz(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that \f[B]-1\f[R]
and less than \f[B]1\f[R], it is printed with a leading zero, regardless
of the use of the \f[B]-z\f[R] option (see the \f[B]OPTIONS\f[R]
section) and without a trailing newline.
.RS
.PP
Otherwise, \f[B]x\f[R] is printed normally, without a trailing newline.
.RE
.TP
\f[B]plznl(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that \f[B]-1\f[R]
and less than \f[B]1\f[R], it is printed with a leading zero, regardless
of the use of the \f[B]-z\f[R] option (see the \f[B]OPTIONS\f[R]
section) and with a trailing newline.
.RS
.PP
Otherwise, \f[B]x\f[R] is printed normally, with a trailing newline.
.RE
.TP
\f[B]pnlz(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that \f[B]-1\f[R]
and less than \f[B]1\f[R], it is printed without a leading zero,
regardless of the use of the \f[B]-z\f[R] option (see the
\f[B]OPTIONS\f[R] section) and without a trailing newline.
.RS
.PP
Otherwise, \f[B]x\f[R] is printed normally, without a trailing newline.
.RE
.TP
\f[B]pnlznl(x)\f[R]
If \f[B]x\f[R] is not equal to \f[B]0\f[R] and greater that \f[B]-1\f[R]
and less than \f[B]1\f[R], it is printed without a leading zero,
regardless of the use of the \f[B]-z\f[R] option (see the
\f[B]OPTIONS\f[R] section) and with a trailing newline.
.RS
.PP
Otherwise, \f[B]x\f[R] is printed normally, with a trailing newline.
.RE
.TP
\f[B]ubytes(x)\f[R]
Returns the numbers of unsigned integer bytes required to hold the
truncated absolute value of \f[B]x\f[R].
@ -2407,6 +2486,12 @@ greater than \f[B]1\f[R] and is less than \f[B]UINT16_MAX\f[R]
(\f[B]2\[ha]16-1\f[R]), bc(1) will output lines to that length,
including the backslash (\f[B]\[rs]\f[R]).
The default line length is \f[B]70\f[R].
.RS
.PP
The special value of \f[B]0\f[R] will disable line length checking and
print numbers without regard to line length and without backslashes and
newlines.
.RE
.TP
\f[B]BC_BANNER\f[R]
If this environment variable exists and contains an integer, then a

68
manuals/bc/HN.1.md

@ -141,6 +141,14 @@ The following are the options that bc(1) accepts.
This is a **non-portable extension**.
**-L**, **-\-no-line-length**
: Disables line length checking and prints numbers without backslashes and
newlines. In other words, this option sets **BC_LINE_LENGTH** to **0** (see
the **ENVIRONMENT VARIABLES** section).