min and max

From ZDoom Wiki
Revision as of 02:07, 17 March 2009 by Agent ME (talk | contribs) (Created page with '{{DISPLAYTITLE:min and max}} These simple but useful functions return the least or greatest of two parameters. <pre> function int min (int a, int b) { if (a < b) return a; r...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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;
}