If the arithmetic operator is legal (is shown in the table), a calculation
is performed and the result returned.
The two values used in the computation are passed following the first and second $@ operators.
The lvalue follows the first $@ operator, and the rvalue follows the second. The
arithmetic operation specified is performed on the two values and the result is returned.
Computations are always performed using integer calculations, and the values are always
interpreted as integer values. A division by 0 always returns a failed lookup (the EXCEPTION).
The less-than and equality arithmetic operators return the literal token TRUE or
FALSE, indicating the truth of the comparison.
To demonstrate this arith database-map type, you can run sendmail on the mini configuration
file listed earlier. If that file were called demo.cf you might test it like this:
% /usr/sbin/sendmail -Cdemo.cf -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter
> Calculate 1 + 1
Calculate input: 1 + 1
Calculate returns: 2
> Calculate 5 / 0
Calculate input: 5 / 0
Calculate returns: EXCEPTION
> Calculate 5 / 2
Calculate input: 5 / 2
Calculate returns: 2
> Calculate -1 * 4
Calculate input: -1 * 4
Calculate returns: -4
> Calculate 2 = 2
Calculate input: 2 = 2
Calculate returns: TRUE
> Calculate 0xff / 2
Calculate input: 0xff / 2
Calculate returns: 0
* Multiplication: multiply lvalue by rvalue
/ Division: divide lvalue by rvalue
l Less-Than: if lvalue is less than rvalue return literal TRUE, otherwise literal FALSE
= Equality: if lvalue is equal to rvalue return literal TRUE, otherwise literal FALSE
| The bitwise OR operation (V8.
Pages:
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586