minv(var x,var y)

Returns the minimum of x and y .

Parameters:

x, y - vars or numbers.

Returns:

x if x <= y
y if y < x

Speed:

Fast

Examples:

x = minv(8, 5); // x is now 5
x = minv(2,2); // x is now 2 
x = minv(-5,10); // x is now -5 
x = minv(10, x); // x can't be higher than 10 
x = minv(10,(maxv(x, 0))) // x will be limited between 0 and 10

See also:

maxv, clamp

► latest version online