From 02b61bd46d981076774ff07d866357ba0534d3cf Mon Sep 17 00:00:00 2001 From: obrien Date: Sun, 16 Jan 2000 10:14:50 +0000 Subject: Merge rev 1.2 into BC 1.0.5a, which fixes a spelling error. --- contrib/bc/doc/dc.1 | 79 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 33 deletions(-) (limited to 'contrib/bc') diff --git a/contrib/bc/doc/dc.1 b/contrib/bc/doc/dc.1 index c4821b7..856b6bb 100644 --- a/contrib/bc/doc/dc.1 +++ b/contrib/bc/doc/dc.1 @@ -2,7 +2,7 @@ .\" dc.1 - the *roff document processor source for the dc manual .\" .\" This file is part of GNU dc. -.\" Copyright (C) 1994, 1997 Free Software Foundation, Inc. +.\" Copyright (C) 1994, 1997, 1998 Free Software Foundation, Inc. .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by @@ -18,6 +18,8 @@ .\" along with this program; see the file COPYING. If not, write to .\" the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. .\" +.\" $FreeBSD$ +.\" .TH DC 1 "1997-03-25" "GNU Project" .ds dc \fIdc\fP .ds Dc \fIDc\fP @@ -61,10 +63,21 @@ Prints the value on the top of the stack, without altering the stack. A newline is printed after the value. .TP -.B P +.B n Prints the value on the top of the stack, popping it off, and does not print a newline after. .TP +.B P +Pops off the value on top of the stack. +If it it a string, it is simply printed without a trailing newline. +Otherwise it is a number, and the integer portion of its absolute +value is printed out as a "base (UCHAR_MAX+1)" byte stream. +Assuming that (UCHAR_MAX+1) is 256 +(as it is on most machines with 8-bit bytes), +the sequence \fBKSK 0k1/ [_1*]sx d0>x [256~aPd0a will not. .TP +.BI !> r +Similar but invokes the macro if the original top-of-stack is +not greater than (less than or equal to) what was the second-to-top. +.TP .BI < r Similar but invokes the macro if the original top-of-stack is less. .TP +.BI !< r +Similar but invokes the macro if the original top-of-stack is +not less than (greater than or equal to) what was the second-to-top. +.TP .BI = r Similar but invokes the macro if the two numbers popped are equal. +.TP +.BI != r +Similar but invokes the macro if the two numbers popped are not equal. .ig This can also be validly used to compare two strings for equality. .. @@ -392,7 +408,7 @@ the value pushed is 0. .TP .B z -Pushes the current stack depth; +Pushes the current stack depth: the number of objects on the stack before the execution of the .B z command. @@ -401,6 +417,9 @@ Miscellaneous .TP .B ! Will run the rest of the line as a system command. +Note that parsing of the !<, !=, and !> commands take precidence, +so if you want to run a command starting with <, =, or > you will +need to add a space after the !. .TP .B # Will interpret the rest of the line as a comment. @@ -416,18 +435,12 @@ Pops the top-of-stack and uses it as an index into the array .IR r . The selected value is then pushed onto the stack. -.SH -NOTES -.PP -The array operations -.B : -and -.B ; -are usually only used by traditional implementations of -.IR bc . -(The GNU -.I bc -is self contained and does not need \*(dc to run.) +.P +Note that each stacked instance of a register has its own +array associated with it. +Thus \fB1 0:a 0Sa 2 0:a La 0;ap\fP will print 1, +because the 2 was stored in an instance of 0:a that +was later popped. .SH BUGS .PP -- cgit v1.1