Quark  0.1
NumericUtils.h++
Go to the documentation of this file.
1 #ifndef __libquark_util_NumericUtils_hxx
2 #define __libquark_util_NumericUtils_hxx
3 
4 namespace quark {
5 namespace util {
6 
16 template<typename T>
17 inline T numeric_clip(T value, T min, T max)
18 {
19  if(value < min)
20  return(min);
21 
22  if(value > max)
23  return(max);
24 
25  return(value);
26 }
27 
28 } // namespace util
29 } // namespace quark
30 
31 #endif // __libquark_util_NumericUtils_hxx
Definition: BarChartView.h++:6
T numeric_clip(T value, T min, T max)
A numeric range-clipping function.
Definition: NumericUtils.h++:17