|
Newsletters
|
|
|
|
|
WMLScript Reference
WMLScript Reference
WMLScript > Lang > min()
min() - The min Function
Usage: min(value1, value2)
Description: Returns the minimum value of the given two numbers. The value and type returned is the same as the value and type of the selected number. The selection is done in the following way:
- WMLScript operator data type conversion rules for integers and floating-points must be used to specify the data type (integer or floating-point) for comparison.
- Compare the numbers to select the smaller one.
- If the values are equal then the first value is selected.
Example:var a = -3;
var b = Lang.abs(a);
var c = Lang.min(a,b); // c = -3
var d = Lang.min(45, 76.3); // d = 45 (integer)
var e = Lang.min(45, 45.0); // e = 45 (integer)
Bookmark this page
|
|