8 #define PRECISION_LIB 0 13 #ifdef _STANDARD_ // standard library available 21 #ifdef _STANDARD_ // standard library available 34 {
return numeric_limits<Real>::digits10 ; }
40 {
return numeric_limits<Real>::digits; }
45 static int MaximumDecimalExponent()
46 {
return numeric_limits<Real>::max_exponent10; }
48 static int MaximumExponent()
49 {
return numeric_limits<Real>::max_exponent; }
51 static Real LnMaximum()
55 {
return numeric_limits<Real>::min(); }
57 static int MinimumDecimalExponent()
58 {
return numeric_limits<Real>::min_exponent10; }
60 static int MinimumExponent()
61 {
return numeric_limits<Real>::min_exponent; }
63 static Real LnMinimum()
67 {
return numeric_limits<Real>::radix; }
71 return numeric_limits<Real>::round_style ==
72 round_to_nearest ? 1 : 0;
78 #else // _STANDARD_ not defined 80 #ifndef SystemV // if there is float.h 92 {
return FLT_EPSILON; }
95 {
return FLT_MANT_DIG; }
100 static int MaximumDecimalExponent()
101 {
return FLT_MAX_10_EXP; }
103 static int MaximumExponent()
104 {
return FLT_MAX_EXP; }
106 static Real LnMaximum()
112 static int MinimumDecimalExponent()
113 {
return FLT_MIN_10_EXP; }
115 static int MinimumExponent()
116 {
return FLT_MIN_EXP; }
118 static Real LnMinimum()
122 {
return FLT_RADIX; }
125 {
return FLT_ROUNDS; }
129 #endif // USING_FLOAT 142 static Real Epsilon()
143 {
return DBL_EPSILON; }
145 static int Mantissa()
146 {
return DBL_MANT_DIG; }
151 static int MaximumDecimalExponent()
152 {
return DBL_MAX_10_EXP; }
154 static int MaximumExponent()
155 {
return DBL_MAX_EXP; }
157 static Real LnMaximum()
169 static int MinimumDecimalExponent()
170 {
return DBL_MIN_10_EXP; }
172 static int MinimumExponent()
173 {
return DBL_MIN_EXP; }
175 static Real LnMinimum()
180 {
return FLT_RADIX; }
183 {
return FLT_ROUNDS; }
187 #endif // USING_DOUBLE 189 #else // if there is no float.h 191 #ifdef OPT_COMPATIBLE 192 #define FLT_MAX MAXFLOAT 203 static Real Epsilon()
204 {
return pow(2.0,(
int)(1-FSIGNIF)); }
210 static Real LnMaximum()
216 static Real LnMinimum()
221 #endif // USING_FLOAT 232 {
return pow(2.0,(
int)(1-DSIGNIF)); }
236 {
return MAXDOUBLE; }
239 {
return LN_MAXDOUBLE; }
242 {
return MINDOUBLE; }
245 {
return LN_MINDOUBLE; }
248 #endif // USING_DOUBLE 259 #endif // use_namespace 263 #endif // PRECISION_LIB
Real Minimum(const BaseMatrix &B)
Real Maximum(const BaseMatrix &B)
Floating point precision (type double).