Browse Source

Fix typos in the manuals

signals
Gavin Howard 3 years ago
parent
commit
979243097f
Signed by untrusted user who does not match committer: gavin
GPG Key ID: 4377E1364E9F1CB0
  1. 12
      manuals/bc.1
  2. 26
      manuals/bc.1.ronn
  3. 30
      manuals/dc.1
  4. 47
      manuals/dc.1.ronn

12
manuals/bc.1

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "BC" "1" "July 2019" "Gavin D. Howard" "General Commands Manual"
.TH "BC" "1" "September 2019" "Gavin D. Howard" "General Commands Manual"
.
.SH "NAME"
\fBbc\fR \- arbitrary\-precision arithmetic language and calculator
@ -50,7 +50,7 @@ First, if a function is called on startup to turn bc(1) into a number converter,
\fBalias d2o="bc \-e ibase=A \-e obase=8"; alias h2b="bc \-e ibase=G \-e obase=2"\fR
.
.IP
Second, if a function\'s purpose is to set \fBibase\fR, \fBobase\fR, or \fBscale\fR globally for any other purpose, it could be split into one to three functions (based on how many globals it sets) and each of those functions could return the desired value for a global\.
Second, if the purpose of a function is to set \fBibase\fR, \fBobase\fR, or \fBscale\fR globally for any other purpose, it could be split into one to three functions (based on how many globals it sets) and each of those functions could return the desired value for a global\.
.
.IP
If this behavior is desired for every run of bc(1), then users could make sure to define \fBBC_ENV_ARGS\fR and include this option (see the ENVIRONMENT VARIABLES section for more details)\.
@ -180,7 +180,7 @@ Identifiers (\fBI\fR) start with a lowercase letter and can be followed by any n
The \fBscale\fR of an expression is the number of digits in the result of the expression right of the decimal point, and \fBscale\fR is a global variable that sets the precision of any operations, with exceptions\. \fBscale\fR is initially \fB0\fR\. \fBscale\fR cannot be negative\. The max allowable value for \fBscale\fR can be queried in bc(1) programs with the \fBmaxscale()\fR built in function\.
.
.P
bc(1) has both \fBglobal\fR variables and \fBlocal\fR variables\. All \fBlocal\fR variables are local to the function; they are parameters or are introduced in a function\'s \fBauto\fR list (see FUNCTIONS)\. If a variable is accessed which is not a parameter or in the \fBauto\fR list, it is assumed to be \fBglobal\fR\. If a parent function has a \fBlocal\fR variable version of a \fBglobal\fR variable that is accessed by a function that it calls, the value of that \fBglobal\fR variable in the child function is the value of the variable in the parent function, not the value of the actual \fBglobal\fR variable\.
bc(1) has both \fBglobal\fR variables and \fBlocal\fR variables\. All \fBlocal\fR variables are local to the function; they are parameters or are introduced in the \fBauto\fR list of a function (see FUNCTIONS)\. If a variable is accessed which is not a parameter or in the \fBauto\fR list, it is assumed to be \fBglobal\fR\. If a parent function has a \fBlocal\fR variable version of a \fBglobal\fR variable that is accessed by a function that it calls, the value of that \fBglobal\fR variable in the child function is the value of the variable in the parent function, not the value of the actual \fBglobal\fR variable\.
.
.P
All of the above applies to arrays as well\.
@ -260,7 +260,7 @@ Array indices (\fBI[E]\fR)\.
\fBlength(I[])\fR: The number of elements in the array \fBI\fR\. This is a \fBnon\-portable extension\fR\.
.
.IP "7." 4
\fBscale(E)\fR: \fBE\fR\'s \fBscale\fR\.
\fBscale(E)\fR: The \fBscale\fR of \fBE\fR\.
.
.IP "8." 4
\fBabs(E)\fR: The absolute value of \fBE\fR\. This is a \fBnon\-portable extension\fR\.
@ -459,7 +459,7 @@ This is only available if bc(1) has been compiled with the extra math option ena
.
.TP
\fB@\fR
The \fBset precision\fR operator takes two expressions and returns a copy of the first with its \fBscale\fR equal to the value of the second expression\. That could either mean that the number is returned without change (if the first expression\'s \fBscale\fR matches the value of the second expression), extended (if it is less), or truncated (if it is more)\.
The \fBset precision\fR operator takes two expressions and returns a copy of the first with its \fBscale\fR equal to the value of the second expression\. That could either mean that the number is returned without change (if the \fBscale\fR of the first expression matches the value of the second expression), extended (if it is less), or truncated (if it is more)\.
.
.IP
The second expression must be an integer (no \fBscale\fR) and non\-negative\.
@ -1367,7 +1367,7 @@ Converting to a hardware integer happens for the second operand of the power (\f
A parse error occurred\.
.
.IP
Parse errors include unexpected \fBEOF\fR, using an invalid character, failing to find the end of a string or comment, using a token where it\'s invalid, giving an invalid expression, giving an invalid print statement, giving an invalid function definition, attempting to assign to an expression that is not a \fInamed expression\fR, giving an invalid \fBauto\fR list, having a duplicate \fBauto\fR/function parameter, failing to find the end of a code block, attempting to return a value from a \fBvoid\fR function, attempting to use a variable as a reference, and using any extensions when the option \fB\-s\fR or any equivalents were given\.
Parse errors include unexpected \fBEOF\fR, using an invalid character, failing to find the end of a string or comment, using a token where it is invalid, giving an invalid expression, giving an invalid print statement, giving an invalid function definition, attempting to assign to an expression that is not a \fInamed expression\fR, giving an invalid \fBauto\fR list, having a duplicate \fBauto\fR/function parameter, failing to find the end of a code block, attempting to return a value from a \fBvoid\fR function, attempting to use a variable as a reference, and using any extensions when the option \fB\-s\fR or any equivalents were given\.
.
.TP
\fB3\fR

26
manuals/bc.1.ronn

@ -58,7 +58,7 @@ The following are the options that bc(1) accepts.
`alias d2o="bc -e ibase=A -e obase=8"; alias h2b="bc -e ibase=G -e obase=2"`
Second, if a function's purpose is to set `ibase`, `obase`, or `scale`
Second, if the purpose of a function is to set `ibase`, `obase`, or `scale`
globally for any other purpose, it could be split into one to three
functions (based on how many globals it sets) and each of those functions
could return the desired value for a global.
@ -219,13 +219,13 @@ sets the precision of any operations, with exceptions. `scale` is initially `0`.
in bc(1) programs with the `maxscale()` built in function.
bc(1) has both **global** variables and **local** variables. All **local**
variables are local to the function; they are parameters or are introduced in a
function's `auto` list (see FUNCTIONS). If a variable is accessed which is not a
parameter or in the `auto` list, it is assumed to be **global**. If a parent
function has a **local** variable version of a **global** variable that is
accessed by a function that it calls, the value of that **global** variable in
the child function is the value of the variable in the parent function, not the
value of the actual **global** variable.
variables are local to the function; they are parameters or are introduced in
the `auto` list of a function (see FUNCTIONS). If a variable is accessed which
is not a parameter or in the `auto` list, it is assumed to be **global**. If a
parent function has a **local** variable version of a **global** variable that
is accessed by a function that it calls, the value of that **global** variable
in the child function is the value of the variable in the parent function, not
the value of the actual **global** variable.
All of the above applies to arrays as well.
@ -279,7 +279,7 @@ side of [`assignment` operators](#bc-assignment).
5. `length(E)`: The number of significant decimal digits in `E`.
6. `length(I[])`: The number of elements in the array `I`. This is a
**non-portable extension**.
7. `scale(E)`: `E`'s **scale**.
7. `scale(E)`: The **scale** of `E`.
8. `abs(E)`: The absolute value of `E`. This is a **non-portable extension**.
9. `I()`, `I(E)`, `I(E, E)`, and so on, where `I` is an identifier for a
non-[void function](#void-functions). The `E` parameters may also be arrays
@ -447,9 +447,9 @@ The operators will be described in more detail below.
* `@`:
The `set precision` operator takes two expressions and returns a copy of the
first with its **scale** equal to the value of the second expression. That
could either mean that the number is returned without change (if the first
expression's **scale** matches the value of the second expression), extended
(if it is less), or truncated (if it is more).
could either mean that the number is returned without change (if the
**scale** of the first expression matches the value of the second
expression), extended (if it is less), or truncated (if it is more).
The second expression must be an integer (no **scale**) and non-negative.
@ -1265,7 +1265,7 @@ bc(1) returns the following exit statuses:
A parse error occurred.
Parse errors include unexpected `EOF`, using an invalid character, failing
to find the end of a string or comment, using a token where it's invalid,
to find the end of a string or comment, using a token where it is invalid,
giving an invalid expression, giving an invalid print statement, giving an
invalid function definition, attempting to assign to an expression that is
not a [named expression](#bc-named-expressions), giving an invalid `auto`

30
manuals/dc.1

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "DC" "1" "July 2019" "Gavin D. Howard" "General Commands Manual"
.TH "DC" "1" "September 2019" "Gavin D. Howard" "General Commands Manual"
.
.SH "NAME"
\fBdc\fR \- arbitrary\-precision reverse\-Polish notation calculator
@ -47,7 +47,7 @@ This is a \fBnon\-portable extension\fR\.
Disables the prompt in interactive mode\. This is mostly for those users that do not want a prompt or are not used to having them in \fBdc\fR\. Most of those users would want to put this option in \fBDC_ENV_ARGS\fR\.
.
.IP
If the prompt has been disabled while building bc(1), this option is a no\-op\.
If the prompt has been disabled while building dc(1), this option is a no\-op\.
.
.IP
This is a \fBnon\-portable extension\fR\.
@ -83,7 +83,7 @@ This is a \fBnon\-portable extension\fR\.
Any non\-error output is written to \fBstdout\fR\.
.
.P
\fBNote\fR: Unlike other dc(1) implementations, this dc(1) will issue a fatal error (see the EXIT STATUS section) if it cannot write to \fBstdout\fR, so if \fBstdout\fR is closed, as in \fBbc <file> >&\-\fR, it will quit with an error\. This is done so that dc(1) can report problems when \fBstdout\fR is redirected to a file\.
\fBNote\fR: Unlike other dc(1) implementations, this dc(1) will issue a fatal error (see the EXIT STATUS section) if it cannot write to \fBstdout\fR, so if \fBstdout\fR is closed, as in \fBdc <file> >&\-\fR, it will quit with an error\. This is done so that dc(1) can report problems when \fBstdout\fR is redirected to a file\.
.
.P
If there are scripts that depend on the behavior of other dc(1) implementations, it is recommended that those scripts be changed to redirect \fBstdout\fR to \fB/dev/null\fR\.
@ -92,7 +92,7 @@ If there are scripts that depend on the behavior of other dc(1) implementations,
Any error output is written to \fBstderr\fR\.
.
.P
\fBNote\fR: Unlike other dc(1) implementations, this dc(1) will issue a fatal error (see the EXIT STATUS section) if it cannot write to \fBstderr\fR, so if \fBstderr\fR is closed, as in \fBbc <file> 2>&\-\fR, it will quit with an error\. This is done so that dc(1) can report problems when \fBstderr\fR is redirected to a file\.
\fBNote\fR: Unlike other dc(1) implementations, this dc(1) will issue a fatal error (see the EXIT STATUS section) if it cannot write to \fBstderr\fR, so if \fBstderr\fR is closed, as in \fBdc <file> 2>&\-\fR, it will quit with an error\. This is done so that dc(1) can report problems when \fBstderr\fR is redirected to a file\.
.
.P
If there are scripts that depend on the behavior of other dc(1) implementations, it is recommended that those scripts be changed to redirect \fBstderr\fR to \fB/dev/null\fR\.
@ -155,7 +155,7 @@ Prints the value on top of the stack, whether number or string, and pops it off
Pops a value off the stack\.
.
.IP
If the value is a number, it is truncated and the result\'s absolute value is printed as though \fBobase\fR is \fBUCHAR_MAX + 1\fR and each digit is interpreted as an ASCII character, making it a byte stream\.
If the value is a number, it is truncated and the absolute value of the result is printed as though \fBobase\fR is \fBUCHAR_MAX + 1\fR and each digit is interpreted as an ASCII character, making it a byte stream\.
.
.IP
If the value is a string, it is printed without a trailing newline\.
@ -175,11 +175,11 @@ These are the commands used for arithmetic\.
.
.TP
\fB+\fR
The top two values are popped off the stack, added, and the result is pushed onto the stack\. The result\'s \fBscale\fR is equal to the max \fBscale\fR of both operands\.
The top two values are popped off the stack, added, and the result is pushed onto the stack\. The \fBscale\fR of the result is equal to the max \fBscale\fR of both operands\.
.
.TP
\fB\-\fR
The top two values are popped off the stack, subtracted, and the result is pushed onto the stack\. The result\'s \fBscale\fR is equal to the max \fBscale\fR of both operands\.
The top two values are popped off the stack, subtracted, and the result is pushed onto the stack\. The \fBscale\fR of the result is equal to the max \fBscale\fR of both operands\.
.
.TP
\fB*\fR
@ -187,7 +187,7 @@ The top two values are popped off the stack, multiplied, and the result is pushe
.
.TP
\fB/\fR
The top two values are popped off the stack, divided, and the result is pushed onto the stack\. The result\'s \fBscale\fR is equal to \fBscale\fR\.
The top two values are popped off the stack, divided, and the result is pushed onto the stack\. The \fBscale\fR of the result is equal to \fBscale\fR\.
.
.TP
\fB%\fR
@ -212,7 +212,7 @@ The first value popped off the stack must be an integer\.
.
.TP
\fBv\fR
The top value is popped off the stack, its square root is computed, and the result is pushed onto the stack\. The result\'s \fBscale\fR is equal to \fBscale\fR\.
The top value is popped off the stack, its square root is computed, and the result is pushed onto the stack\. The \fBscale\fR of the result is equal to \fBscale\fR\.
.
.TP
\fB_\fR
@ -247,7 +247,7 @@ This is a \fBnon\-portable extension\fR\.
.
.TP
\fB@\fR
The top two values are popped off the stack, and the second\'s precision is set to the value of the first, whether by truncation or extension\.
The top two values are popped off the stack, and the precision of the second is set to the value of the first, whether by truncation or extension\.
.
.IP
The first value must be an integer and non\-negative\.
@ -353,7 +353,7 @@ Pops the value off the top of the (main) stack and pushes it onto the stack of r
.
.TP
\fBL\fR\fIr\fR
Pops the value off the top of register \fBr\fR\'s stack and push it onto the main stack\. The previous value in register \fBr\fR\'s stack, if any, is now accessible via the \fBl\fR\fIr\fR command\.
Pops the value off the top of the stack for register \fBr\fR and push it onto the main stack\. The previous value in the stack for register \fBr\fR, if any, is now accessible via the \fBl\fR\fIr\fR command\.
.
.SS "Parameters"
These commands control the values of \fBibase\fR, \fBobase\fR, and \fBscale\fR (see the SYNTAX section)\.
@ -416,7 +416,7 @@ This is a \fBnon\-portable extension\fR\.
The following commands control strings\.
.
.P
dc(1) can work with both numbers and strings, and registers (see the REGISTERS section) can hold both strings and numbers\. dc(1) always knows whether a register\'s contents are a string or a number\.
dc(1) can work with both numbers and strings, and registers (see the REGISTERS section) can hold both strings and numbers\. dc(1) always knows whether the contents of a register are a string or a number\.
.
.P
While arithmetic operations have to have numbers, and will print an error if given a string, other commands accept strings\.
@ -535,7 +535,7 @@ Reads a line from the \fBstdin\fR and executes it\. This is to allow macros to r
.
.TP
\fBq\fR
During execution of a macro, this exits that macro\'s execution and the execution of the macro that executed it\. If there are no macros, or only one macro executing, dc(1) exits\.
During execution of a macro, this exits the execution of that macro and the execution of the macro that executed it\. If there are no macros, or only one macro executing, dc(1) exits\.
.
.TP
\fBQ\fR
@ -583,7 +583,7 @@ Pops the value on top of the stack and uses it as an index into the array \fBr\f
Registers are names that can store strings, numbers, and arrays\. (Number/string registers do not interfere with array registers\.)
.
.P
Each register is also its own stack, so the current register value is the top of the register\'s stack\. All registers, when first referenced, have one value (\fB0\fR) in their stack\.
Each register is also its own stack, so the current register value is the top of the stack for the register\. All registers, when first referenced, have one value (\fB0\fR) in their stack\.
.
.P
In non\-extended register mode, a register name is just the single character that follows any command that needs a register name\. The only exception is a newline (\fB\'\en\'\fR); it is a parse error for a newline to be used as a register name\.
@ -710,7 +710,7 @@ Converting to a hardware integer happens for the second operand of the power (\f
A parse error occurred\.
.
.IP
Parse errors include unexpected \fBEOF\fR, using an invalid character, failing to find the end of a string or comment, and using a token where it\'s invalid\.
Parse errors include unexpected \fBEOF\fR, using an invalid character, failing to find the end of a string or comment, and using a token where it is invalid\.
.
.TP
\fB3\fR

47
manuals/dc.1.ronn

@ -60,7 +60,7 @@ The following are the options that dc(1) accepts.
do not want a prompt or are not used to having them in `dc`. Most of those
users would want to put this option in `DC_ENV_ARGS`.
If the prompt has been disabled while building bc(1), this option is a
If the prompt has been disabled while building dc(1), this option is a
no-op.
This is a **non-portable extension**.
@ -100,7 +100,7 @@ Any non-error output is written to `stdout`.
**Note**: Unlike other dc(1) implementations, this dc(1) will issue a fatal
error (see the EXIT STATUS section) if it cannot write to `stdout`, so if
`stdout` is closed, as in `bc <file> >&-`, it will quit with an error. This is
`stdout` is closed, as in `dc <file> >&-`, it will quit with an error. This is
done so that dc(1) can report problems when `stdout` is redirected to a file.
If there are scripts that depend on the behavior of other dc(1) implementations,
@ -114,7 +114,7 @@ Any error output is written to `stderr`.
**Note**: Unlike other dc(1) implementations, this dc(1) will issue a fatal
error (see the EXIT STATUS section) if it cannot write to `stderr`, so if
`stderr` is closed, as in `bc <file> 2>&-`, it will quit with an error. This is
`stderr` is closed, as in `dc <file> 2>&-`, it will quit with an error. This is
done so that dc(1) can report problems when `stderr` is redirected to a file.
If there are scripts that depend on the behavior of other dc(1) implementations,
@ -216,9 +216,9 @@ Printing numbers in scientific notation and/or engineering notation is a
* `P`:
Pops a value off the stack.
If the value is a number, it is truncated and the result's absolute value is
printed as though `obase` is `UCHAR_MAX + 1` and each digit is interpreted
as an ASCII character, making it a byte stream.
If the value is a number, it is truncated and the absolute value of the
result is printed as though `obase` is `UCHAR_MAX + 1` and each digit is
interpreted as an ASCII character, making it a byte stream.
If the value is a string, it is printed without a trailing newline.
@ -236,13 +236,13 @@ These are the commands used for arithmetic.
* `+`:
The top two values are popped off the stack, added, and the result is pushed
onto the stack. The result's **scale** is equal to the max **scale** of both
operands.
onto the stack. The **scale** of the result is equal to the max **scale** of
both operands.
* `-`:
The top two values are popped off the stack, subtracted, and the result is
pushed onto the stack. The result's **scale** is equal to the max **scale**
of both operands.
pushed onto the stack. The **scale** of the result is equal to the max
**scale** of both operands.
* `*`:
The top two values are popped off the stack, multiplied, and the result is
@ -253,7 +253,7 @@ These are the commands used for arithmetic.
* `/`:
The top two values are popped off the stack, divided, and the result is
pushed onto the stack. The result's **scale** is equal to `scale`.
pushed onto the stack. The **scale** of the result is equal to `scale`.
* `%`:
The top two values are popped off the stack, remaindered, and the result is
@ -279,7 +279,8 @@ These are the commands used for arithmetic.
* `v`:
The top value is popped off the stack, its square root is computed, and the
result is pushed onto the stack. The result's **scale** is equal to `scale`.
result is pushed onto the stack. The **scale** of the result is equal to
`scale`.
* `_`:
If this command *immediately* precedes a number (i.e., no spaces or other
@ -313,8 +314,8 @@ These are the commands used for arithmetic.
This is a **non-portable extension**.
* `@`:
The top two values are popped off the stack, and the second's precision is
set to the value of the first, whether by truncation or extension.
The top two values are popped off the stack, and the precision of the second
is set to the value of the first, whether by truncation or extension.
The first value must be an integer and non-negative.
@ -407,9 +408,9 @@ These commands control registers (see the REGISTERS section).
of register `r`. The previous value of the register becomes inaccessible.
* `L`*r*:
Pops the value off the top of register `r`'s stack and push it onto the main
stack. The previous value in register `r`'s stack, if any, is now accessible
via the `l`*r* command.
Pops the value off the top of the stack for register `r` and push it onto
the main stack. The previous value in the stack for register `r`, if any, is
now accessible via the `l`*r* command.
### Parameters
@ -467,8 +468,8 @@ SYNTAX section).
The following commands control strings.
dc(1) can work with both numbers and strings, and registers (see the REGISTERS
section) can hold both strings and numbers. dc(1) always knows whether a
register's contents are a string or a number.
section) can hold both strings and numbers. dc(1) always knows whether the
contents of a register are a string or a number.
While arithmetic operations have to have numbers, and will print an error if
given a string, other commands accept strings.
@ -581,7 +582,7 @@ be printed with a newline after and then popped from the stack.
request input from users.
* `q`:
During execution of a macro, this exits that macro's execution and the
During execution of a macro, this exits the execution of that macro and the
execution of the macro that executed it. If there are no macros, or only one
macro executing, dc(1) exits.
@ -632,8 +633,8 @@ Registers are names that can store strings, numbers, and arrays. (Number/string
registers do not interfere with array registers.)
Each register is also its own stack, so the current register value is the top of
the register's stack. All registers, when first referenced, have one value (`0`)
in their stack.
the stack for the register. All registers, when first referenced, have one value
(`0`) in their stack.
In non-extended register mode, a register name is just the single character that
follows any command that needs a register name. The only exception is a newline
@ -794,7 +795,7 @@ dc(1) returns the following exit statuses:
A parse error occurred.
Parse errors include unexpected `EOF`, using an invalid character, failing
to find the end of a string or comment, and using a token where it's
to find the end of a string or comment, and using a token where it is
invalid.
* `3`:

Loading…
Cancel
Save