Product Administration Guide > Configuration Rule Assembly Language >
Arithmetic Operators
Arithmetic operators expect numeric operands and produce a numeric result. They are most frequently used in subexpressions. The following toplevel expression means that the quantity of item C in the solution must be the same as the sum of the quantities of items A and B. ==(+([A],[B]),[C])
Assuming no other constraints on item A, B, or C; if you add A or B to the solution, then C will be added as well to match the sum. If you add a large number of C's, the eConfigurator engine will add A and B in arbitrary quantities so that their sum equals the amount of C. When used in subexpressions, these operators should return a numeric result. If a subexpression returns a logical result, true is interpreted as a 1, and false is interpreted as a 0. In the example above, if B is an expression that returns the logical result true, then the expression is equivalent to the following: ==(+([A],1),[C])
Arithmetic operators are shown in Table 40.
Table 40. Arithmetic Operators



Addition 
+( A, B )

Sum of A and B. A and B can be items or subexpressions. Result is floating point if A or B is floating point. 
Subtraction 
( A, B )

Subtracts B from A. A and B can be items or subexpressions. Result is floating point if A or B is floating point. 
Negation 
( A )

Additive inverse of A. Uses only one operand. A can be an item or expression. 
Multiplication 
*( A, B )

Product of A and B. Result is floating point if A or B is floating point. A and B can be items or subexpressions. 
Division 
/( A, B )

Quotient of A divided by B. Truncates ratio to integer if both A and B are integers. Result is floating point if A or B is floating point. A and B can be items or subexpressions. 
Modulo 
%( A, B )

Remainder of A divided by B. For example, %(1900, 72) results in 28. If A or B is floating point, the value is first rounded to the nearest integer; then the remainder is computed as for integers. A and B can be items or subexpressions. 
Minimum 
min( A, B )

Result is the smaller of A and B and is floating point if A or B is floating point. A and B can be items or subexpressions. 
Maximum 
max( A, B )

Result is the larger of A and B and is floating point if A or B is floating point. A and B can be items or subexpressions. 
The following operators, shown in Table 41, also take numeric arguments and produce numeric results. Use them to control numeric accuracy or change numeric characteristics.
Table 41. Additional Arithmetic Operators



Quantity 
qty( A )

Result is the quantity of A rounded to nearest integer. For example, if A is 6.7, returns 7. If A is 6.3, returns 6. A can be an item or subexpression. Useful only with resources. 
Integer 
int( A )

Truncates A down to an integer. For example, if operand is 6.7, returns 6. A can be an item or subexpression. Useful only with resources. 
Float 
flo( A )

Converts A to floating point. Same as multiplying operand by 1.0. A can be a subexpression. Not useful with resources. 
Absolute value 
abs( A )

Returns the absolute value of A. A can be an item or subexpression. 
Sign test 
sgn( A )

Returns 1 if the quantity of A <0, 0 if A=0, 1 if A>0. A can be a subexpression. 
