diff options
author | Gavin Howard <yzena.tech@gmail.com> | 2019-11-30 15:46:30 -0700 |
---|---|---|
committer | Gavin Howard <yzena.tech@gmail.com> | 2019-11-30 15:46:30 -0700 |
commit | e8a90e61931917fef6e09997b48c440975ad5975 (patch) | |
tree | 9d0b57a1309882b9e233976595b495e54b91a278 | |
parent | 3b6c07e28ca7b6b9705ff1556ec07eb7eada116f (diff) | |
download | bc-e8a90e61931917fef6e09997b48c440975ad5975.tar.gz |
Add docs for the M and m commands to the dc manual
-rw-r--r-- | manuals/dc.1 | 22 | ||||
-rw-r--r-- | manuals/dc.1.ronn | 22 |
2 files changed, 42 insertions, 2 deletions
diff --git a/manuals/dc.1 b/manuals/dc.1 index d42c0e4d..4cf53df5 100644 --- a/manuals/dc.1 +++ b/manuals/dc.1 @@ -329,6 +329,26 @@ The top two values are popped off of the stack, they are compared, and a \fB1\fR .IP This is a \fBnon\-portable extension\fR\. . +.TP +\fBM\fR +The top two values are popped off of the stack\. If they are both non\-zero, a \fB1\fR is pushed onto the stack\. If either of them is zero, or both of them are, then a \fB0\fR is pushed onto the stack\. +. +.IP +This is like the \fB&&\fR operator in bc(1), and it is not a short\-circuit operator\. +. +.IP +This is a \fBnon\-portable extension\fR\. +. +.TP +\fBm\fR +The top two values are popped off of the stack\. If at least one of them is non\-zero, a \fB1\fR is pushed onto the stack\. If both of them are zero, then a \fB0\fR is pushed onto the stack\. +. +.IP +This is like the \fB||\fR operator in bc(1), and it is not a short\-circuit operator\. +. +.IP +This is a \fBnon\-portable extension\fR\. +. .SS "Stack Control" These commands control the stack\. . @@ -438,7 +458,7 @@ Strings can also be executed as macros\. For example, if the string \fB[1pR]\fR . .TP \fB[\fR\fIcharacters\fR\fB]\fR -Makes a string containing \fBcharacters\fR and pushes it onto the stack\. +Makes a string containing \fIcharacters\fR and pushes it onto the stack\. . .IP If there are brackets (\fB[\fR and \fB]\fR) in the string, then they must be balanced\. Unbalanced brackets can be escaped using a backslash (\fB\e\fR) character\. diff --git a/manuals/dc.1.ronn b/manuals/dc.1.ronn index 60284fa9..7d1f0c9e 100644 --- a/manuals/dc.1.ronn +++ b/manuals/dc.1.ronn @@ -385,6 +385,26 @@ These are the commands used for arithmetic. This is a **non-portable extension**. + * `M`: + The top two values are popped off of the stack. If they are both non-zero, a + `1` is pushed onto the stack. If either of them is zero, or both of them + are, then a `0` is pushed onto the stack. + + This is like the `&&` operator in bc(1), and it is not a short-circuit + operator. + + This is a **non-portable extension**. + + * `m`: + The top two values are popped off of the stack. If at least one of them is + non-zero, a `1` is pushed onto the stack. If both of them are zero, then a + `0` is pushed onto the stack. + + This is like the `||` operator in bc(1), and it is not a short-circuit + operator. + + This is a **non-portable extension**. + ### Stack Control These commands control the stack. @@ -489,7 +509,7 @@ executed as a macro, then the code `1pR` is executed, meaning that the `1` will be printed with a newline after and then popped from the stack. * `[`*characters*`]`: - Makes a string containing `characters` and pushes it onto the stack. + Makes a string containing *characters* and pushes it onto the stack. If there are brackets (`[` and `]`) in the string, then they must be balanced. Unbalanced brackets can be escaped using a backslash (`\`) |