Skip to content

Min Operator

See Also: Max Operator

Purpose

To return the lesser of two values from an expression.

Syntax

( {value1} min {value2} )

where {value1} and {value2} may be either expressions, variables, or constants.

What It Does

When two values are connected with an encompassing expression by min, the encompassing expression evaluates as the lesser of the two values.

Example

move (nWeightBill min nWeightJoe) to nLighterPerson

In this example, if Bill weighs less than Joe, the value of nWeightBill would be moved to nLighterPerson. Otherwise, nWeightJoe would be moved to nLighterPerson.

Multiple mins may be used to link more than two values into a single expression that evaluates as the minimum of all the values in the expression:

Example

move (nWeightBill min nWeightJoe min nWeightCory) to nLighterPerson

In this example, the weight of the lightest person among Bill, Joe, and Cory is moved to nLighterPerson.

Notes

  • There is no symbolic substitute for the word min.

  • When mins, maxs, and other operators are intermingled in a single expression without grouping parentheses, evaluation proceeds from left to right with each operator connecting the next expression with the result of all previous (left-lying) ones.

(1 max 2 min 3 max 4)

would evaluate as 4, while

(1 min 2 max 3 min 4)

would evaluate as 3.