IsoEx
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
NumLimitsT.hh
1 /*===========================================================================*\
2  * *
3  * OpenFlipper *
4  * Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
5  * www.openflipper.org *
6  * *
7  *---------------------------------------------------------------------------*
8  * This file is part of OpenFlipper. *
9  * *
10  * OpenFlipper is free software: you can redistribute it and/or modify *
11  * it under the terms of the GNU Lesser General Public License as *
12  * published by the Free Software Foundation, either version 3 of *
13  * the License, or (at your option) any later version with the *
14  * following exceptions: *
15  * *
16  * If other files instantiate templates or use macros *
17  * or inline functions from this file, or you compile this file and *
18  * link it with other files to produce an executable, this file does *
19  * not by itself cause the resulting executable to be covered by the *
20  * GNU Lesser General Public License. This exception does not however *
21  * invalidate any other reasons why the executable file might be *
22  * covered by the GNU Lesser General Public License. *
23  * *
24  * OpenFlipper is distributed in the hope that it will be useful, *
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
27  * GNU Lesser General Public License for more details. *
28  * *
29  * You should have received a copy of the GNU LesserGeneral Public *
30  * License along with OpenFlipper. If not, *
31  * see <http://www.gnu.org/licenses/>. *
32  * *
33 \*===========================================================================*/
34 
35 /*===========================================================================*\
36  * *
37  * $Revision: 10745 $ *
38  * $Author: moebius $ *
39  * $Date: 2011-01-26 10:23:50 +0100 (Mi, 26. Jan 2011) $ *
40  * *
41 \*===========================================================================*/
42 
43 
44 
45 
46 //=============================================================================
47 //
48 // CLASS NumLimitsT
49 //
50 //=============================================================================
51 
52 #ifndef ACG_NUMLIMITS_HH
53 #define ACG_NUMLIMITS_HH
54 
55 //#ifndef WIN32
56 # undef min
57 # undef max
58 //#endif
59 
60 
61 //== INCLUDES =================================================================
62 
63 #include <limits.h>
64 #include <float.h>
65 
66 //== NAMESPEACES ==============================================================
67 
68 namespace ACG {
69 
70 //== CLASS DEFINITION =========================================================
71 
72 
89 template <typename Scalar>
91 {
92 public:
94  static inline Scalar min() { return 0; }
96  static inline Scalar max() { return 0; }
97 };
98 
99 
100 template<> inline int NumLimitsT<int>::min() { return INT_MIN; }
101 template<> inline int NumLimitsT<int>::max() { return INT_MAX; }
102 
103 template<> inline float NumLimitsT<float>::min() { return FLT_MIN; }
104 template<> inline float NumLimitsT<float>::max() { return FLT_MAX; }
105 
106 template<> inline double NumLimitsT<double>::min() { return DBL_MIN; }
107 template<> inline double NumLimitsT<double>::max() { return DBL_MAX; }
108 
109 
110 //=============================================================================
111 } // namespace ACG
112 //=============================================================================
113 #endif // ACG_NUMLIMITS_HH defined
114 //=============================================================================
115 
Definition: Matrix4x4T.cc:65
Definition: NumLimitsT.hh:90
static Scalar min()
Return the smallest absolte value a scalar type can store.
Definition: NumLimitsT.hh:94
static Scalar max()
Return the maximum absolte value a scalar type can store.
Definition: NumLimitsT.hh:96