Infamous Min, Max functions
I agree it is obvious but it better be here - for complectness sake.

Usage is pretty obvious, too.

'------------------------------------------------
function max(x,y)
    max = x
    if y>x then max = y
end function
 
'------------------------------------------------
function min(x,y)
    min = x
    if y<x then min = y
end function