Name

Math.min( ) Method — determine the smaller of two numbers

Availability

Flash 5; may be used when exporting Flash 4 movies

Synopsis

Math.min(x, y)

Arguments

x

A number.

y

A number.

Returns

The smaller of x and y.

Example

Math.min(5, 1);    // Returns 1
Math.min(-6, -5);  // Returns -6

Reader Exercise: Modify the example under Math.max( ) to return the minimum value in an array rather than the maximum.

See Also

Math.max( )

Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.