Lines Matching refs:Type

66   // Type name.
67 typedef T Type;
68 // Unsigned version of the Type with the same byte size.
69 // Same as Type for floating point and unsigned types.
76 static const Type kPosMin;
78 static const Type kPosMax;
80 static const Type kMin;
82 static const Type kMax;
85 static const Type kNegMin;
88 static const Type kNegMax;
93 // Smallest positive value such that Type(1) + kEpsilon != Type(1)
94 static const Type kEpsilon;
99 static const Type kStdError;
105 static const Type kNaN;
108 static const Type kPosInf;
111 static const Type kNegInf;
120 static bool IsFinite(const Type x);
121 static bool IsNaN(const Type x);
122 static bool IsInf(const Type x);
123 static bool IsPosInf(const Type x);
124 static bool IsNegInf(const Type x);
136 #define SIGNED_INT_MAX(Type) \
137 (((Type(1) << (sizeof(Type)*8 - 2)) - 1) + (Type(1) << (sizeof(Type)*8 - 2)))
139 #define SIGNED_INT_MIN(Type) \
140 (-(Type(1) << (sizeof(Type)*8 - 2)) - (Type(1) << (sizeof(Type)*8 - 2)))
142 #define UNSIGNED_INT_MAX(Type) \
143 (((Type(1) << (sizeof(Type)*8 - 1)) - 1) + (Type(1) << (sizeof(Type)*8 - 1)))
146 #define SIGNED_MAX_10_EXP(Type) \
147 (sizeof(Type) == 1 ? 2 : ( \
148 sizeof(Type) == 2 ? 4 : ( \
149 sizeof(Type) == 4 ? 9 : ( \
150 sizeof(Type) == 8 ? 18 : -1))))
152 #define UNSIGNED_MAX_10_EXP(Type) \
153 (sizeof(Type) == 1 ? 2 : ( \
154 sizeof(Type) == 2 ? 4 : ( \
155 sizeof(Type) == 4 ? 9 : ( \
156 sizeof(Type) == 8 ? 19 : -1))))
159 static bool IsFinite(const Type /*x*/) { return true; } \
160 static bool IsNaN(const Type /*x*/) { return false; } \
161 static bool IsInf(const Type /*x*/) { return false; } \
162 static bool IsPosInf(const Type /*x*/) { return false; } \
163 static bool IsNegInf(const Type /*x*/) { return false; }
168 typedef IntType Type; \
172 static const Type kPosMin = 1; \
173 static const Type kPosMax = SIGNED_INT_MAX(Type); \
174 static const Type kMin = SIGNED_INT_MIN(Type); \
175 static const Type kMax = kPosMax; \
176 static const Type kNegMin = -1; \
177 static const Type kNegMax = kMin; \
179 static const int kMax10Exp = SIGNED_MAX_10_EXP(Type); \
180 static const Type kEpsilon = 1; \
181 static const Type kStdError = 0; \
188 typedef IntType Type; \
192 static const Type kPosMin = 1; \
193 static const Type kPosMax = UNSIGNED_INT_MAX(Type); \
194 static const Type kMin = 0; \
195 static const Type kMax = kPosMax; \
197 static const int kMax10Exp = UNSIGNED_MAX_10_EXP(Type); \
198 static const Type kEpsilon = 1; \
199 static const Type kStdError = 0; \
226 static bool IsFinite(const Type x) { return _finite(x); } \
227 static bool IsNaN(const Type x) { return _isnan(x); } \
228 static bool IsInf(const Type x) { return (_fpclass(x) & (_FPCLASS_NINF | _FPCLASS_PINF)) != 0; } \
229 static bool IsPosInf(const Type x) { return _fpclass(x) == _FPCLASS_PINF; } \
230 static bool IsNegInf(const Type x) { return _fpclass(x) == _FPCLASS_NINF; }
233 static bool IsFinite(const Type x) { return !isinf(x) && !isnan(x); } \
234 static bool IsNaN(const Type x) { return isnan(x); } \
235 static bool IsInf(const Type x) { return isinf(x); } \
236 static bool IsPosInf(const Type x) { return isinf(x) && x > 0; } \
237 static bool IsNegInf(const Type x) { return isinf(x) && x < 0; }
247 typedef FP_Type Type; \
251 static const Type kPosMin; \
252 static const Type kPosMax; \
253 static const Type kMin; \
254 static const Type kMax; \
255 static const Type kNegMin; \
256 static const Type kNegMax; \
259 static const Type kEpsilon; \
260 static const Type kStdError; \
262 static const Type kNaN; \
263 static const Type kPosInf; \
264 static const Type kNegInf; \