@Max (JavaScript)

Returns the largest number in a group of numbers.

Defined in

@Functions (JavaScript)

Syntax

@Max(values:...) : double
Parameter Description
values Numbers or arrays of numbers.
Return value Description
double The largest number.

Usage

Scalar parameters and array parameters are all searched for the maximum value.

Examples

This example generates 16 random numbers and gets the minimum and maximum numbers.
function p(stuff) {
	print("<<<" + stuff + ">>>");
}

var a = new Array();
for(var i = 0; i < 16; i++) {
	a.push(@Random());
}
min = @Min(a);
max = @Max(a);
p("Random numbers " + min + " through " + max);