/usr/share/calc/help/expression is in apcalc-common 2.12.4.4-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | Expression sequences
This is a sequence of statements, of which expression statements
are the commonest case. Statements are separated with semicolons,
and the newline character generally ends the sequence. If any
statement is an expression by itself, or is associated with an
'if' statement which is true, then two special things can happen.
If the sequence is executed at the top level of the calculator,
then the value of '.' is set to the value of the last expression.
Also, if an expression is a non-assignment, then the value of the
expression is automatically printed if its value is not NULL.
Some operations such as pre-increment and plus-equals are also
treated as assignments.
Examples of this are the following:
expression sets '.' to prints
---------- ----------- ------
3+4 7 7
2*4; 8+1; fact(3) 6 8, 9, and 6
x=3^2 9 -
if (3 < 2) 5; else 6 6 6
x++ old x -
print fact(4) - 24
null() null() -
Variables can be defined at the beginning of an expression sequence.
This is most useful for local variables, as in the following example,
which sums the square roots of the first few numbers:
local s, i; s = 0; for (i = 0; i < 10; i++) s += sqrt(i); s
If a return statement is executed in an expression sequence, then
the result of the expression sequence is the returned value. In
this case, '.' is set to the value, but nothing is printed.
## Copyright (C) 1999 Landon Curt Noll
##
## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License
## as published by the Free Software Foundation.
##
## Calc is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
## Public License for more details.
##
## A copy of version 2.1 of the GNU Lesser General Public License is
## distributed with calc under the filename COPYING-LGPL. You should have
## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
##
## @(#) $Revision: 30.1 $
## @(#) $Id: expression,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/expression,v $
##
## Under source code control: 1991/07/21 04:37:18
## File existed as early as: 1991
##
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|