min and max
From ZDoom Wiki
These simple but useful functions return the least or greatest of two parameters.
function int min (int a, int b)
{
if (a < b)
return a;
return b;
}
function int max (int a, int b)
{
if (a > b)
return a;
return b;
}