ICALCV, Utilities, a Portable Infix Calculator
This package was originally made available by (according to
icalcv.txt) Rao Akella, and modified David Mathog
I have found and corrected the "MATH$TRUNC_G multiply
defined" error during linking, and corrected some other
warnings from the C comiler (but not one bad subscript array
warning, due the the code being somewhat 'peculiar':
however, the program does appear to run correctly).
I have also supplied a version of G05CAF in "C", so you
don't need a FORTRAN compiler. The program appears to run
correctly (and identically) on Alpha and IA64: I haven't
tried this version on VAX, or on any other operating system.
Bart Z. Lederman
Original description:
Ever wanted to do a quick calculation and didn't have a
calculator handy? ICALC is a simple, portable and
quickly-accessible program for doing INFIX computations. It
is neither very sophisticated nor intended to provide
enormous flexibility. It merely provides the functionality
of a simple infix pocket calculator.
Features:
~~~~~~~~
1) Addition (+), Subtraction (-), Multiplication (*), Division (/)
2) Modulus (%), Power (^)
3) Bitwise logical operators: bitwise AND (&), bitwise inclusive OR (|),
unary one's complement (~)
4) 20 Math/Trigonometric functions: sin, cos, tan, asin, acos, atan,
sinh, cosh, tanh, exp (exponentiation), ln (natural log),
log (base 10 log), sqrt (square root), ceil (ceiling), floor,
int/trunc (truncation), abs (absolute value),
degtorad (degrees->radians), radtodeg (radians->degrees).
Two Date functions to convert between calendar dates and julian days:
caltojul (calendar->julian date) and jultocal (julian->calendar date).
One '?'-for-help command to display a help screen of all supported
commands and functions.
5) Temporary variables (as many as you want, with names as long as you
want) to store intermediate computations.
6) This is a "portable" calculator in the sense that it's not specific to
any operating system. The yacc output should be compilable by any C
compiler; this program has been tested on Unix, VAX/VMS and PC/MS-DOS,
and has required no changes to compile.
7) This program uses the simplest of input and output formats, and is in
no way hardware dependent. So, as long as it compiles without any
problems, there are no other requirements for it to work properly.
8) All numbers are of the C floating-point type "double", which, according
to the VAX C manual, has a range of 0.29*10^-38 to 1.7*10^38, and has
values precise to 16 decimal digits.
9) Allows any number of expressions on a line, separated by ';'
10) icalc can now be run either interactively (when it is
invoked without any arguments, in which case the user is
prompted for input) or in a command-line mode (when all
expressions to be computed are passed to icalc via
command-line "argv" arguments, in which case icalc computes
and prints the result of each expression -- exactly as if
it had been entered interactively -- and then exits).
In the latter case, the user is supposed to delimit/
separate the expressions by ';'