clamp.h File Reference

(r1785/r751)

Go to the source code of this file.

Functions

template<class T>
ClampBetween (T ToBeClamped, T Min, T Max)


Function Documentation

template<class T>
T ClampBetween ToBeClamped,
Min,
Max
 

------------------------------------------------------------------------------------------------- Author: Harrison Ainsworth Date: 05/99 Purpose: Clamp a value to an interval. Postconditions: The return is within the interval [Min,Max] -------------------------------------------------------------------------------------------------

Definition at line 123 of file clamp.h.

00124 {
00125 
00126     if( ToBeClamped < Min )
00127     {
00128         ToBeClamped = Min;
00129     }
00130     else
00131     if( ToBeClamped > Max )
00132     {
00133         ToBeClamped = Max;
00134     }
00135 
00136     return  ToBeClamped;
00137 
00138 }


Generated on Sat Nov 10 03:49:06 2007 for Camelot by  doxygen 1.4.4