| |
ev (1)
NAME
|
ev - evaluate expressions |
SYNOPSIS
DESCRIPTION
|
Ev evaluates expressions given on the command line,
and sends the results to the standard output, one per line.
An expression contains real numbers, function calls, and the
following operators: |
|
Operators are evaluated left to right, except '^', which is
right associative. Powers have the highest precedence;
multiplication and division are evaluated before addition
and subtraction. Expressions can be grouped with
parentheses. All values are double precision
real. |
|
The following library of functions is
available: |
|
if cond is greater than zero, then is evaluated, otherwise
else is evaluated. |
|
return aN (N is rounded to the nearest integer). If N
is zero, the number of available arguments is
returned. |
|
compute a random number between 0 and 1 based on
x. |
|
return largest integer not greater than x. |
|
return smallest integer not less than x. |
|
compute e to the power of x (e approx =
2.718281828). |
|
compute the logarithm of x to the base e. |
|
compute the logarithm of x to the base 10. |
|
asin(x), acos(x), atan(x) |
|
inverse trigonometric functions. |
|
inverse tangent of y/x (range -pi to pi). |
EXAMPLE
|
To pass the square root of two and the sine of .5 to a
program: |
|
program `ev 'sqrt(2)' 'sin(.5)'` |
AUTHOR
SEE ALSO
|