Unless otherwise stated in this manual, expressions refer to numeric expressions which consist of elements (attributes, variables, distributions, and constants) combined with normal mathematical operators ( + , – , etc.) that result in a numeric value. A numeric expression may be as simple as a variable name or as complex as a formula.

**Expression Elements**

The following table illustrates the expression elements.

Element | Meaning | Examples |
---|---|---|

attribute name | Attribute’s current value | a_Weight a_Pkg_Qty a_SerialNumber |

variable name | Variable’s current value | v_Num_In_System v_Qty_To_Go v_Total_Pieces |

distribution | A probability distribution | T(5, 15, 45) N(34, 3) U(50, 5) |

constant | A specific number | 5 10.25 19.01 |

**Mathematical Operators**

The following table illustrates the use of mathematical operators.

Item | Meaning | Examples |
---|---|---|

+ | addition | a_Weight + 2.5 a_Pkg_Qty + 3.4 |

– | subtraction | v_Num_In_System – 5 100 – v_Qty_To_Go |

* | multiplication | 5 * v_Total_Pieces a_Weight * 0.98 |

/ | division | v_Total_Pieces / 100 a_Pkg_Qty / v_Bin_Qty |

() | parentheses | (v_Total_Pieces – v_Total) / 100 a_Pkg_Qty / (v_Bin_Qty – 100) |

** | exponentiation | a_Pkg_Qty ** v_Total_Pieces 2 ** v_Bin_Qty |

modulus | a_Value1 = 10 a_Value2 = 4 a_Div = a_Value1 / a_Value2 v_Remainder = a_Value1 – (a_Div * a_Value2)// Where a_Div is an integer. |

**Examples of Numeric Expressions**

You may combine items to form a compound expression. Parentheses may be used to set off parts of the expression to be evaluated first. For information on the order in which operators are evaluated to determine the expression’s value, see *Operator Precedence* below.

a_Attr1

50.91

v_Var1 + 5

v_Total_Pieces + 5 * a_Pkg_Qty

(a_Weight + 5) * (a_Pkg_Qty / 2)

N(25, 4.8) + a_Weight * (v_Total_Pieces – 10)

**What are Expressions?**

**What are Numeric Expressions?****What are Boolean Expressions?**