|
Newsletters
|
|
|
|
|
WMLScript Reference
WMLScript Reference
WMLScript > Lang > max()
max() - The max Function
Usage: max(value1, value2)
Description: Returns the maximum 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 larger one.
- If the values are equal then the first value is selected.
Example:var a = -3;
var b = Lang.abs(a);
var c = Lang.max(a,b); // c = 3
var d = Lang.max(45, 76.3); // d = 76 (integer)
var e = Lang.max(45, 45.0); // e = 45.0 (float)
Bookmark this page
|
|