Minimum (Min)

What is it?

Similar to the way the Max function returns the larger of two numeric values, the Min function instead returns the smaller value.

What is the Syntax?

The syntax for the Min function is as follows:

Min( Argument1, Argument2 );

Why might I want to use this?

As the Min and Max statements have similar functionality, their uses are likewise similar. Rather than finding the lower of two known values, which most people could very quickly do for themselves, the Min function should instead be used to find the lower of two dynamic values, such as that of a variable or function call.

Using the example from the Max function section, we can use the Min function to return the number of votes received by the runner-up candidate:

RunnerUpVotes := Min( VotesForBill, VotesForJane );

With Bill receiving 3,050 votes to Jane’s 4,870, this time the value of the function will be 3,050. This is then assigned to the RunnerUpVotes variable.

 

<< Previous: Maximum (Max) | Next: Absolute (Abs) >>