Number Expression

Number expressions are used in rules fields of a number parameter declaration and in boolean expressions. The mathematical operators :

+ addition

- subtraction

* multiplication

/ division between reals

div division between integers

mod modulus

can be used with eventually parantheses in number expressions. The priority of the mathematical operators determines when they are used in the evaluation of an expression:

( )

- + /* single precedings signs */

* /

- +

Operators having the same priority are evaluated from left to right.

ESTA includes a range of mathematical functions which may also be used in forming complex mathematical expressions:

Function Description

abs(X) Returns the absolute value of X

arctan(X) Returns the arctangent of the decimal number X

cf_add(X,Y) Returns a probability which is a combination of X and Y

cf_and(X,Y) Returns the smallest probability between X and Y

cf_not(X) Returns the negated probability of X

cf_or(X,Y) Returns the biggest probability of X and Y

cos(X) Returns the cosine of X

exp(X) Returns the natural exponent of X

int(X) Returns the integer part of number X

ln(X) Returns the natural logarithm of X

log(X) Returns the logarithm of X with base 10

min(X,Y) Returns the smaller of the numbers X and Y

max(X,Y) Returns the bigger of the numbers X and Y

power(X,Y) Returns X raised to Y

sin(X) Returns the sine of X

sqrt(X) Returns the square root of X

strlen(X) Returns the number of characters N in the string X

tan(X) Returns the tangent of X

trunc(X) Returns X truncated

The arguments for trigonometric functions must be specified in degrees.

The syntax for a number expression is:

<number-expression>::=

<number-expression> <number-op> <number-expression> |

<number-function> ( <argumentlist> ) |

<parameter-name> |

<number>

<number-op> ::= + | - | / | * | div | mod

<number-function> ::=

abs | arctan | cf_add | cf_and | cf_not | cf_or |

cos | exp | int | ln | log | max | min |

power | sin | sqrt | strlen | tan | trunc

<argumentlist> ::= <argument> {, <argumentlist> }

<argument> ::= <number-expression>

Examples

salary - tax

number_of_years * year

5 * 8 / x - 7 + y

2 * (3 + 4) /* = 14 */

(sqrt(cos(x)*cos(x)+sin(x)*sin(x)) + 3) / 2 /* = 2 */