New math functions: min, max, clamp

min(a, b) returns the lesser of a and b
max(a, b) returns the greater of a and b
clamp(x, a, b) returns the nearest value to x between a and b