ic man page fixes
mcdaniel at uiucdcsb.CS.UIUC.EDU
mcdaniel at uiucdcsb.CS.UIUC.EDU
Tue Apr 22 15:13:00 AEST 1986
Looking at the man page after installing geoff at imagen's fixes
(thanks!), I noticed a few glitches. For example, the syntax of the
"if" statement as given was wrong, there was no discussion of strings
or of auto-printing of expression values, there were typos, et cetera.
Here are context diffs, suitable for patch, for ic.1:
*** ic.1 Mon Apr 21 22:41:51 1986
--- new.ic.1 Mon Apr 21 22:41:52 1986
***************
*** 6,8
.SH DESCRIPTION
! \fIIc\fP is an attempt at a more useful calculator than provided by
\fIbc\fP(1). Instead of using arbitrary precision integers (or fixed
--- 6,8 -----
.SH DESCRIPTION
! \fIIc\fP is an attempt at a more useful calculator than
\fIbc\fP(1). Instead of using arbitrary precision integers (or fixed
***************
*** 11,13
As a further aid, \fIic\fP has many standard mathematical functions
! pre-programmed and, of course, it can be programed by the user as
well.
--- 11,13 -----
As a further aid, \fIic\fP has many standard mathematical functions
! pre-programmed and, of course, it can be programmed by the user as
well.
***************
*** 17,20
statements at ``reasonable'' times. \fBNewline\fP terminates either
! expressions or single statements typed by the user, inside compound
! statements or function definitions, only a \fB;\fP terminates.
This is designed to be more ``natural'' than \fIbc\fP was when
--- 17,20 -----
statements at ``reasonable'' times. \fBNewline\fP terminates either
! expressions or single statements typed by the user; inside compound
! statements or function definitions, only a \fB;\fP terminates.
This is designed to be more ``natural'' than \fIbc\fP was when
***************
*** 34,39
Other operands
! floating point numbers - can include exponent, need not
! include decimal point nor sign.
! octal numbers - start with a 0, eg 014 is the same as 12.
! hexdecimal numbers - start with "0x", eg 0x1a is the same as 26.
--- 34,45 -----
Other operands
! floating point numbers - can include exponent, need
! include neither decimal point nor sign.
! octal numbers - start with 0; e. g., 014 is the same as 12.
! hexadecimal numbers - start with "0x"; e. g., 0x1a is the same as 26.
! strings - enclosed in double quotes, ";
! only permitted in read statement, function arguments;
! escape sequences are \\0, \\b, \\n, \\t, \\f
! (null, backspace, newline, tab, form feed), but
! otherwise \\x is x for any character x except newline;
! e. g. rc = printf("Why \\"air\\"?\\n").
***************
*** 40,42
(E)
!
name (E)
--- 46,48 -----
(E)
!
name (E)
***************
*** 59,61
if (E) S
! if (E) S then S
while (E) S
--- 65,67 -----
if (E) S
! if (E) S else S
while (E) S
***************
*** 62,64
do S while (E);
! for (opt-E;opt-E; opt-E) S
;
--- 68,70 -----
do S while (E);
! for (opt-E; opt-E; opt-E) S
;
***************
*** 69,71
Function definitions
! define name (name,...,name)
{
--- 75,77 -----
Function definitions
! define name (name, ... , name)
{
***************
*** 71,74
{
! auto name, name;
!
S ... S
--- 77,80 -----
{
! auto name, ... , name;
!
S ... S
***************
*** 80,82
asin, acos, atan, atan2, sinh, cosh, tanh, printf
!
Note: trig functions take and return arguments in
--- 86,88 -----
asin, acos, atan, atan2, sinh, cosh, tanh, printf
!
Note: trig functions take and return arguments in
***************
*** 83,85
degrees - not radians!
!
Printf accepts a reasonable sub-set of the stdio
--- 89,91 -----
degrees - not radians!
!
Printf accepts a reasonable sub-set of the stdio
***************
*** 88,90
! These functions are adapted from the C math library and,
further questions about algorithm and argument usage
--- 94,96 -----
! These functions are adapted from the C math library;
further questions about algorithm and argument usage
***************
*** 91,93
should be directed to the manual.
!
Other commands:
--- 97,99 -----
should be directed to the manual.
!
Other commands:
***************
*** 96,98
expr1 # expr2 print expr1 in base expr2
!
.fi
--- 102,104 -----
expr1 # expr2 print expr1 in base expr2
!
.fi
***************
*** 98,99
.fi
All function arguments are passed by value.
--- 104,106 -----
.fi
+ .PP
All function arguments are passed by value.
***************
*** 99,100
All function arguments are passed by value.
--- 106,124 -----
All function arguments are passed by value.
+ .PP
+ The value of a statement that is an expression is
+ printed, unless the main operator is an assignment or the statement is
+ inside a function or a compound statement.
+ E. g.
+ .nf
+ 11
+ 5 + 6
+ 5 + (a = 6)
+ .fi
+ all print 11, but
+ .nf
+ { 11; }
+ if (b) 5 + 6;
+ b = 5 + (a = 6)
+ .fi
+ print nothing.
***************
*** 106,108
auto a, b, c, i, s;
!
a = 1;
--- 130,132 -----
auto a, b, c, i, s;
!
a = 1;
***************
*** 120,122
.fi
! defines a functino to compute an approximate value of the exponential
function and
--- 144,146 -----
.fi
! defines a function to compute an approximate value of the exponential
function and
***************
*** 125,127
for (i = 1; i < 10; i++)
! printf ("%g\n", exponent (i));
.fi
--- 149,151 -----
for (i = 1; i < 10; i++)
! printf ("%g\\n", exponent (i));
.fi
More information about the Comp.sources.bugs
mailing list