Overview

Eval is a scientific calculator with rudimentary storage and a complete set of functions and operators. To use, you may type "EVAL x", where x is the expression to analyze, or you may simply type "EVAL". In the second case, the program will print a header and prompt you for each expression. Examples:


C> EVAL 2*4
8

C> EVAL

EVAL   V1.0  MSDOS V2.11  01-Sep-87  1:00 PM

EVAL> 2*4
8

EVAL>

You may exit the program with Control-C. To keep a running tally, you may type "\R" (note: that is a backslash, not a slash). To turn off the running tally, type "\N". Parentheses may be used in all expressions, but must having matching left and right sides.

Operators

The following arithmetic operators are available:
! Factorial (do a factorial of the previous value)
% Percentage (divide the previous value by 100)
* Multiply
/ Divide
^ Exponentiation
+ Addition (or unary plus)
- Subtraction (or unary minus)
# Round to the specified number of digits. If rounded to a negative number, it is rounded to the right of the decimal point.
D Random gaussian distribution. For instance, 2D10 will return a random integer between 1 and 10, plus a random integer between 1 and 10 (ie a value between 2 and 20).
MOD Division remainder only
MIN Return left side value if greater than the right side value, otherwise, return the right side value
MAX Return left side value if less than the right side value, otherwise, return the right side value

Note that all operators operate on two values except for unary plus, unary minus, and factorial.

The following integer bit operators are available:

NOT 1's-complement inversion.
AND Bitwise AND
OR Bitwise OR
XOR Bitwise exclusive-OR
NAND Bitwise NOT AND
NOR Bitwise NOT OR
XNOR Bitwise NOT XOR

Constants
PI is a predefined constant equal to 3.14159265...

Functions

Functions have the form:
FUNCTION(expression)

where expression is the value to perform the function on. Available trigonometric functions are:
TAN Tangent
SIN Sine
COS Cosine
SEC Secant
COT Cotangent
CSC Cosecant

ARC and Hyperbolic functions are available by prefixing the trigonometric function name with "ARC", "HYP", or "HYPARC". For instance, "HYPARCSIN".

Other functions available:

RAD Degree to radian conversion
DEG Radian to degree conversion
ABS Absolute value
EXP Constant E raised to the specified power
INT Integer
LOG Natural logrithm
LOG10 Common logrithm
SQR Square root
SGN Sign (returns -1 if negative, 1 if positive, or 0 if 0)
FIB Fibonacci sequence

If an error results from an expression, it means 1) the entered expression had invalid syntax or 2) the resulting number from the expression was too large or too small for the computer.

Variables

Eval provides 26 variables (A through Z). Values can be assigned to variables using the form:
<variable> = <expression>
For instance:
A = PI * 9 + 1

To use the variable in an expression:

A = A + 1

This would add 1 to variable A.

To see the value of a variable, simply type the variable name and press ENTER.