Clamp function

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 19:40, 2 July 2010 by Eliot (talk | contribs) (moved UE1:Clamp function to Clamp function over redirect: revert)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Clamp is math function provided by the Object

()

class.

native(251) static final function int Clamp (int V, int A,int B)

Limits V to the interval of [A, B]. Exactly speaking, A will be returned if V is smaller than A, B will be returned if V is larger than B, otherwise V is returned.

This also applies if A is larger than B. So if V is larger than B, but smaller than A, the value of A is returned even though V is actually between the two values.