MIN function

Purpose: MIN compares two floating point values and returns the smallest one. By default MIN takes doubles as arguments and returns doubles as function results. TO use the MIN function with single floating point and integers an intermediate variable must be used.


 Syntax:

 RetVal# = MIN(Value1, Value2)

 Parameters:

  • Value1 Number to be compared to Value2.
  • Value2 Number to be compared to Value1.

 Return Value:

  • RetVal#, the return value, is the smaller of Value1 or Value2.

Example 1:


 PRINT MIN(2.1, 3.2)

Result:

Displays 2.1

Example 2:


 DIM RetVal#
 RetVal# = MIN(2.1, 3.2)
 PRINT RetVal# 
 

Result:

2.1

TO use the MIN function with single floating point and integers an intermediate variable must be used. For example, for single floating point minimum value use


 DIM a!, b!, c!
 a! = 2.1
 b! = 3.2
 c! = MIN(a!, b!)
 PRINT c!