The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



Expression


Unit:SDL_math2
Class:TMathExpression
Declaration:property Expression: string;

The property Expression contains the mathematical or logical expression to be evaluated. The expression is not case sensitive, however you should be careful to avoid improper mixing of boolean and arithmetic subexpressions, for example:
(a>5) and (b=0) yields a boolean result, while
(a+5) and (b=0) yields an integer value (the and operator is used as a bitwise and)

You may use any number of user-defined variables, provided that the variable names are not equal to any of the reserved function names (see below). A user-defined variable always starts with a letter and may consist of any number of digits and letters and the underscore character ('_'). See Evaluate for further details on variables.

The expression may use the following pre-defined constants, operators, and functions:

--- Constants ---
true logical true (or -1, if used as number)
false logical false (or 0, if used as number)
pi the number Pi (3.14159...)
--- Arithmetic Operators ---
+ sum: x+y
- difference: x-y
* product: x*y
/ division: x/y
# modulo: round(x) mod round(y)
^ power: exponentiation x^y , x>0, y..any real values
--- Logic Operators ---
> greater than
>= greater than or equal
= equal
>< not equal
< less than
<= less than or equal
and boolean or bitwise and
not boolean or bitwise not
or boolean or bitwise or
xor boolean or bitwise exclusive or
--- Functions ---
abs absolute value: abs(x), x..any real value
arccos inverse cosine: arccos(x), x..angle in radians
arcsin inverse sine: arcsin(x), x..angle in radians
arctan inverse tangens: arctan(x), x..angle in radians
cos cosine: cos(x), x..angle in radians
exp exponential function: exp(x)
frac fraction: frac(x) = x - int(x)
gauss gauss creates normally distributed random numbers with zero mean and unit standard deviation
int round towards zero: int(x)
lg decadic logarithm: lg(x)
ln natural logarithm: ln(x)
rand uniformly distributed random numbers: random(x), x..amplitude of noise (mean = 0.0)
round round to the nearest integer: round(x)
sign sign of x: sign(x)
sin sinus: sin(x)
sqr square: sqr(x)
sqrt square root: sqrt(x)
tan tangens: tan(x)


Last Update: 2008-Okt-29