| idc | Utilities Manual | idc |
NAME
idc - a text-oriented, integer, infix desk calculator
SYNOPSIS
idc
DESCRIPTION
idc is an integer, text-oriented, infix calculator. It allows
the use of variables and built-in functions.
Operations
supported are `+', `-', `*', `/', `%', `<' (left shift), `>' (right shift),
`|', `&' and `^' (exclusive or).
mode is a built-in variable whose special
meaning is explained below. It is used in conjunction with the built-in
constants
bin, oct, dec
and hex.
Expressions are typed in C-language format, and operators
have the same precedences and associativities as in
C-language expressions. As an example,
to assign the value of 12 % 5
to the variable result, type:
result = 12 % 5;
The calculator will type out the value of the expression.
It assumes all constants are integer values. Floating-point
values are not allowed.
Standard C notation can be used for typing in constants. Binary
constants can be typed in using the prefix of 0b.
Once a variable has been assigned a value, it is available for use on the right-hand side in succeeding expressions.
Results are only printed
out when a semi-colon terminating the expression is received.
The value of the built-in variable mode determines
the format used to print results. It can be set to
one of the built-in constants
bin, oct, dec
or hex.
Its default value is dec.
Calculator use is terminated by terminating the text stream being processed by the calculator. The manner in which this is done will depend on the operating environment and the source of the stream.
SEE ALSO
American National Standards Institute, American National Standard for Information Processing Systems -- Programming Language -- C (X3.159-1989).
COPYING
Copyright 1999-2006 Robert Burkhardt
This program is free software; you can redistribute it and/or modify it under the terms Version 2 of the GNU General Public License as published by the Free Software Foundation.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. You can also find a copy at the Free Software Foundation's website, http://www.gnu.org.
BUGS
None currently known.
Please send any bug reports to
R. Burkhardt, P.O. Box 426164, Cambridge, MA 02142-0021 or
bobwb@juno.com.
| 14 September 2006 | Software Services |