Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

vnl_numeric_limits.h

Go to the documentation of this file.
00001 #ifndef vnl_numeric_limits_h_
00002 #define vnl_numeric_limits_h_
00003 // This is vxl/vnl/vnl_numeric_limits.h
00004 
00005 //: \file
00006 //  \brief Standard limits for numeric datatypes
00007 //  \author Andrew W. Fitzgibbon, Oxford RRG, 28 Aug 96
00008 //    Implementation of the May 96 ANSI Draft Working Paper (DWP)
00009 //    numeric_limits class.  Numbering in
00010 //    the documentation below refers to section 18.2 of the DWP.
00011 //
00012 //  Modifications:
00013 //  LSB (Manchester) 23/3/01 Documentation tidied
00014 //
00015 //-----------------------------------------------------------------------------
00016 
00017 #include <vcl_compiler.h>
00018 
00019 //: 18.2.1.3  Type float_round_style                     [lib.round.style]
00020 
00021 enum vnl_float_round_style {
00022   vnl_round_indeterminate       = -1,
00023   vnl_round_toward_zero         =  0,
00024   vnl_round_to_nearest          =  1,
00025   vnl_round_toward_infinity     =  2,
00026   vnl_round_toward_neg_infinity =  3
00027 };
00028 
00029 #ifdef infinity
00030 # error
00031 #endif
00032 
00033 template<class T>
00034 class vnl_numeric_limits {
00035 public:
00036 
00037 //: Distingishes between scalar types, whixh have specialisations, and non-scalar types, which don't
00038   static const bool is_specialized;
00039 
00040 //: Minimum finite value.
00041 //  (Equivalent to CHAR_MIN, SHRT_MIN, FLT_MIN, DBL_MIN, etc)
00042 //
00043 //  For  floating types with denormalization, returns the minimum positive
00044 //   normalized value, denorm_min().
00045 //
00046 //  Meaningful for all specializations in which  is_bounded  ==  true,  or
00047 //   is_bounded == false && is_signed == false.
00048   static T min();
00049 
00050 //: Maximum finite value
00051 // Equivalent to CHAR_MAX, SHRT_MAX, FLT_MAX, DBL_MAX, etc.
00052 //  Meaningful for all specializations in which is_bounded == true.
00053   static T max();
00054 
00055 //:  Number of radix digits which can be represented without change.
00056 //  For built-in integer types, the number of non-sign bits in the
00057 //   representation.
00058 //  For floating point types, the number of radix digits in the mantissa.
00059 //   Equivalent to FLT_MANT_DIG, DBL_MANT_DIG, LDBL_MANT_DIG.
00060   static const int  digits;
00061 
00062 //:  Number of base 10 digits which can be represented without change.
00063 //   Equivalent to FLT_DIG, DBL_DIG, LDBL_DIG.
00064 // Meaningful for all specializations in which is_bounded == true.
00065   static const int  digits10;
00066 
00067 //: True if the type is signed.
00068   static const bool is_signed; 
00069 
00070 //; True if the type is integer  
00071   static const bool is_integer; 
00072   
00073 //: True if the type uses an exact representation
00074 //  All integer types are exact, but not vice versa.  
00075 //  For example, rational and fixed-exponent
00076 //  representations are exact but not integer.
00077   static const bool is_exact;
00078 
00079 //:
00080 //  For floating types, specifies the base or radix of the exponent
00081 //    representation (often 2).  Equivalent to FLT_RADIX.
00082 //  For integer types, specifies the base of the representation -
00083 //    distinguishes types with bases other than 2 (e.g. BCD).
00084   static const int  radix;
00085 
00086 //:  Machine epsilon: 
00087 //  The difference between 1 and the least value greater
00088 //    than 1 that is representable.  Equivalent to FLT_EPSILON, DBL_EPSILON,
00089 //    LDBL_EPSILON.
00090 //  Meaningful only for floating point types.
00091   static T epsilon();
00092 
00093 //:  Measure of the maximum rounding error
00094 //  This has a precise definition in
00095 //    the Language Independent Arithmetic (LIA-1) standard.  Required by LIA-1.
00096   static T round_error();
00097 
00098 
00099 //: Minimum negative integer such that radix raised to that  power  is  in
00100 //    range.  Equivalent to FLT_MIN_EXP, DBL_MIN_EXP, LDBL_MIN_EXP.
00101 //  Meaningful only for floating point types.
00102   static const int  min_exponent;
00103 
00104 //: Minimum  negative  integer  such  that  10  raised to that power is in
00105 //    range. Equivalent to FLT_MIN_10_EXP, DBL_MIN_10_EXP, LDBL_MIN_10_EXP.
00106 //  Meaningful only for floating point types.
00107   static const int  min_exponent10;
00108 
00109 //: Maximum positive integer such that radix raised to that  power  is  in
00110 //    range. Equivalent to FLT_MAX_EXP, DBL_MAX_EXP, LDBL_MAX_EXP.
00111 //  Meaningful only for floating point types.
00112   static const int  max_exponent;
00113 
00114 //:  Maximum  positive  integer  such  that  10  raised to that power is in
00115 //    range. Equivalent to FLT_MAX_10_EXP, DBL_MAX_10_EXP, LDBL_MAX_10_EXP.
00116 //  Meaningful only for floating point types.
00117   static const int  max_exponent10;
00118 
00119 //: True if the type has a representation for positive infinity.
00120 //  Meaningful only for floating point types.
00121 //  Shall be true for all specializations in which is_iec559 == true.
00122   static const bool has_infinity;
00123 
00124 //: True if the type has a representation for a quiet (non-signaling)
00125 //   ``Not a Number.''.  RLIA
00126 //  Meaningful only for floating point types.
00127 //  Shall be true for all specializations in which is_iec559 == true.
00128   static const bool has_quiet_NaN;
00129 
00130 //: True if the type has a representation for a signaling
00131 //    ``Not a Number.''.
00132 //  Meaningful only for floating point types.
00133 //  Shall be true for all specializations in which is_iec559 == true.
00134   static const bool has_signaling_NaN;
00135 
00136 //: True if the type allows denormalized values (variable number of exponent
00137 //    bits).
00138 //  Meaningful only for flotaing point types.
00139   static const bool has_denorm;
00140 
00141 //: Representation of positive infinity, if available.
00142   static T infinity();
00143 
00144 //: Representation of a quiet ``Not a Number,'' if available.
00145   static T quiet_NaN();
00146 
00147 //: Representation of a signaling ``Not a Number,'' if available.
00148   static T signaling_NaN();
00149 
00150 //: Minimum positive denormalized value.
00151 //  Meaningful for all floating point types.
00152 //  In specializations for which has_denorm == false, returns the  minimum
00153 //    positive normalized value.
00154 //  For types with has_denorm == false, the member denorm_min() shall
00155 //    return the same value as the member min().
00156   static T denorm_min();
00157 
00158 //: True if and only if the type adheres to IEC 559 standard.
00159 //    International Electrotechnical Commission standard 559 is the same as
00160 //    IEEE 754.
00161   static const bool is_iec559;
00162 
00163 //: True if the set of values representable by the type is finite.
00164 //    All built-in types are bounded, this member would be false for arbitrary
00165 //    precision types.
00166   static const bool is_bounded;
00167 
00168 //: True if the type is modulo. A type is modulo if it is  possible  to
00169 //    add  two  positive  numbers  and have a result which wraps around to a
00170 //    third number which is less.
00171 //  Generally, this is false for floating types, true for unsigned integers,
00172 //    and true for signed integers on most machines.
00173   static const bool is_modulo;
00174 
00175 //: True if trapping is implemented for the type.
00176   static const bool traps;
00177 
00178 //: True if tinyness is detected before rounding. Refer to IEC 559.
00179   static const bool tinyness_before;
00180 
00181 //: The rounding style for the type. Equivalent to FLT_ROUNDS.
00182 //    Specializations for integer types shall return round_toward_zero.
00183   static const vnl_float_round_style round_style;
00184 };
00185 
00186 // SPECIALIZATIONS :
00187 
00188 // -------------------- #include <vnl/vnl_numeric_limits_int.h>
00189 
00190 #ifdef IUE_64_BIT
00191 # define vnl_tmp_signed32 ????
00192 #else
00193 # define vnl_tmp_signed32 int
00194 #endif
00195 
00196 VCL_DEFINE_SPECIALIZATION
00197 class vnl_numeric_limits<vnl_tmp_signed32> {
00198 public:
00199   static const bool is_specialized VCL_STATIC_CONST_INIT_INT(true);
00200   inline static int min() { return -0x7fffffff; }
00201   inline static int max() { return  0x7fffffff; }
00202   static const int digits   VCL_STATIC_CONST_INIT_INT(31);
00203   static const int digits10 VCL_STATIC_CONST_INIT_INT(9);
00204   static const bool is_signed  VCL_STATIC_CONST_INIT_INT(true);
00205   static const bool is_integer VCL_STATIC_CONST_INIT_INT(true);
00206   static const bool is_exact   VCL_STATIC_CONST_INIT_INT(true);
00207   static const int radix VCL_STATIC_CONST_INIT_INT(2);
00208   inline static int epsilon()     { return 0; }
00209   inline static int round_error() { return 0; }
00210   static const int min_exponent   VCL_STATIC_CONST_INIT_INT(-31);
00211   static const int min_exponent10 VCL_STATIC_CONST_INIT_INT(-9);
00212   static const int max_exponent   VCL_STATIC_CONST_INIT_INT(31);
00213   static const int max_exponent10 VCL_STATIC_CONST_INIT_INT(9);
00214   static const bool has_infinity      VCL_STATIC_CONST_INIT_INT(false);
00215   static const bool has_quiet_NaN     VCL_STATIC_CONST_INIT_INT(false);
00216   static const bool has_signaling_NaN VCL_STATIC_CONST_INIT_INT(false);
00217   static const bool has_denorm        VCL_STATIC_CONST_INIT_INT(false);
00218   static int infinity() { return max(); }
00219   static int quiet_NaN();
00220   static int signaling_NaN();
00221   inline static int denorm_min()    { return min(); }
00222   static const bool is_iec559  VCL_STATIC_CONST_INIT_INT(false);
00223   static const bool is_bounded VCL_STATIC_CONST_INIT_INT(true);
00224   static const bool is_modulo  VCL_STATIC_CONST_INIT_INT(true);
00225   static const bool traps      VCL_STATIC_CONST_INIT_INT(false);
00226   static const bool tinyness_before VCL_STATIC_CONST_INIT_INT(false);
00227   static const vnl_float_round_style round_style VCL_STATIC_CONST_INIT_INT(vnl_round_toward_zero);
00228 };
00229 
00230 #undef vnl_tmp_signed32
00231 
00232 VCL_DEFINE_SPECIALIZATION
00233 class vnl_numeric_limits<unsigned char> {
00234 public:
00235   static const bool is_specialized VCL_STATIC_CONST_INIT_INT(true);
00236   inline static unsigned int min() { return 0; }
00237   inline static unsigned int max() { return 0xff; }
00238   static const int digits   VCL_STATIC_CONST_INIT_INT(sizeof(unsigned char) * 8 );
00239   static const int digits10 VCL_STATIC_CONST_INIT_INT( (digits * 301) / 1000 );
00240   static const bool is_signed  VCL_STATIC_CONST_INIT_INT(false);
00241   static const bool is_integer VCL_STATIC_CONST_INIT_INT(true);
00242   static const bool is_exact   VCL_STATIC_CONST_INIT_INT(true);
00243   static const int radix VCL_STATIC_CONST_INIT_INT(2);
00244   inline static int epsilon()     { return 0; }
00245   inline static int round_error() { return 0; }
00246   static const int min_exponent   VCL_STATIC_CONST_INIT_INT(0);
00247   static const int min_exponent10 VCL_STATIC_CONST_INIT_INT(0);
00248   static const int max_exponent   VCL_STATIC_CONST_INIT_INT(5);
00249   static const int max_exponent10 VCL_STATIC_CONST_INIT_INT(2);
00250   static const bool has_infinity      VCL_STATIC_CONST_INIT_INT(false);
00251   static const bool has_quiet_NaN     VCL_STATIC_CONST_INIT_INT(false);
00252   static const bool has_signaling_NaN VCL_STATIC_CONST_INIT_INT(false);
00253   static const bool has_denorm        VCL_STATIC_CONST_INIT_INT(false);
00254   static int infinity() { return max(); }
00255   static int quiet_NaN();
00256   static int signaling_NaN();
00257   inline static int denorm_min()    { return min(); }
00258   static const bool is_iec559  VCL_STATIC_CONST_INIT_INT(false);
00259   static const bool is_bounded VCL_STATIC_CONST_INIT_INT(true);
00260   static const bool is_modulo  VCL_STATIC_CONST_INIT_INT(true);
00261   static const bool traps      VCL_STATIC_CONST_INIT_INT(false);
00262   static const bool tinyness_before VCL_STATIC_CONST_INIT_INT(false);
00263   static const vnl_float_round_style round_style VCL_STATIC_CONST_INIT_INT(vnl_round_toward_zero);
00264 };
00265 
00266 
00267 
00268 VCL_DEFINE_SPECIALIZATION
00269 class vnl_numeric_limits<long> {
00270 public:
00271   static const bool is_specialized VCL_STATIC_CONST_INIT_INT(true);
00272   inline static int min() { return -0x7fffffff; }
00273   inline static int max() { return  0x7fffffff; }
00274   static const int digits   VCL_STATIC_CONST_INIT_INT(31);
00275   static const int digits10 VCL_STATIC_CONST_INIT_INT(9);
00276   static const bool is_signed  VCL_STATIC_CONST_INIT_INT(true);
00277   static const bool is_integer VCL_STATIC_CONST_INIT_INT(true);
00278   static const bool is_exact   VCL_STATIC_CONST_INIT_INT(true);
00279   static const int radix VCL_STATIC_CONST_INIT_INT(2);
00280   inline static int epsilon()     { return 0; }
00281   inline static int round_error() { return 0; }
00282   static const int min_exponent   VCL_STATIC_CONST_INIT_INT(-31);
00283   static const int min_exponent10 VCL_STATIC_CONST_INIT_INT(-9);
00284   static const int max_exponent   VCL_STATIC_CONST_INIT_INT(31);
00285   static const int max_exponent10 VCL_STATIC_CONST_INIT_INT(9);
00286   static const bool has_infinity      VCL_STATIC_CONST_INIT_INT(false);
00287   static const bool has_quiet_NaN     VCL_STATIC_CONST_INIT_INT(false);
00288   static const bool has_signaling_NaN VCL_STATIC_CONST_INIT_INT(false);
00289   static const bool has_denorm        VCL_STATIC_CONST_INIT_INT(false);
00290   static int infinity() { return max(); }
00291   static int quiet_NaN();
00292   static int signaling_NaN();
00293   inline static int denorm_min()    { return min(); }
00294   static const bool is_iec559  VCL_STATIC_CONST_INIT_INT(false);
00295   static const bool is_bounded VCL_STATIC_CONST_INIT_INT(true);
00296   static const bool is_modulo  VCL_STATIC_CONST_INIT_INT(true);
00297   static const bool traps      VCL_STATIC_CONST_INIT_INT(false);
00298   static const bool tinyness_before VCL_STATIC_CONST_INIT_INT(false);
00299   static const vnl_float_round_style round_style VCL_STATIC_CONST_INIT_INT(vnl_round_toward_zero);
00300 };
00301 
00302 
00303 VCL_DEFINE_SPECIALIZATION
00304 class vnl_numeric_limits<unsigned long> {
00305 public:
00306   static const bool is_specialized VCL_STATIC_CONST_INIT_INT(true);
00307   inline static unsigned int min() { return 0; }
00308   inline static unsigned int max() { return 0xffffffff; }
00309   static const int digits   VCL_STATIC_CONST_INIT_INT(sizeof(unsigned long) * 8 );
00310   static const int digits10 VCL_STATIC_CONST_INIT_INT( (digits * 301) / 1000 );
00311   static const bool is_signed  VCL_STATIC_CONST_INIT_INT(false);
00312   static const bool is_integer VCL_STATIC_CONST_INIT_INT(true);
00313   static const bool is_exact   VCL_STATIC_CONST_INIT_INT(true);
00314   static const int radix VCL_STATIC_CONST_INIT_INT(2);
00315   inline static int epsilon()     { return 0; }
00316   inline static int round_error() { return 0; }
00317   static const int min_exponent   VCL_STATIC_CONST_INIT_INT(-31);
00318   static const int min_exponent10 VCL_STATIC_CONST_INIT_INT(-9);
00319   static const int max_exponent   VCL_STATIC_CONST_INIT_INT(31);
00320   static const int max_exponent10 VCL_STATIC_CONST_INIT_INT(9);
00321   static const bool has_infinity      VCL_STATIC_CONST_INIT_INT(false);
00322   static const bool has_quiet_NaN     VCL_STATIC_CONST_INIT_INT(false);
00323   static const bool has_signaling_NaN VCL_STATIC_CONST_INIT_INT(false);
00324   static const bool has_denorm        VCL_STATIC_CONST_INIT_INT(false);
00325   static int infinity() { return max(); }
00326   static int quiet_NaN();
00327   static int signaling_NaN();
00328   inline static int denorm_min()    { return min(); }
00329   static const bool is_iec559  VCL_STATIC_CONST_INIT_INT(false);
00330   static const bool is_bounded VCL_STATIC_CONST_INIT_INT(true);
00331   static const bool is_modulo  VCL_STATIC_CONST_INIT_INT(true);
00332   static const bool traps      VCL_STATIC_CONST_INIT_INT(false);
00333   static const bool tinyness_before VCL_STATIC_CONST_INIT_INT(false);
00334   static const vnl_float_round_style round_style VCL_STATIC_CONST_INIT_INT(vnl_round_toward_zero);
00335 };
00336 
00337 VCL_DEFINE_SPECIALIZATION
00338 class vnl_numeric_limits<unsigned short > {
00339 public:
00340   static const bool is_specialized VCL_STATIC_CONST_INIT_INT(true);
00341   inline static unsigned int min() { return 0; }
00342   inline static unsigned int max() { return 0xffff; }
00343   static const int digits   VCL_STATIC_CONST_INIT_INT(sizeof(unsigned short) * 8 );
00344   static const int digits10 VCL_STATIC_CONST_INIT_INT( (digits * 301) / 1000 );
00345   static const bool is_signed  VCL_STATIC_CONST_INIT_INT(false);
00346   static const bool is_integer VCL_STATIC_CONST_INIT_INT(true);
00347   static const bool is_exact   VCL_STATIC_CONST_INIT_INT(true);
00348   static const int radix VCL_STATIC_CONST_INIT_INT(2);
00349   inline static int epsilon()     { return 0; }
00350   inline static int round_error() { return 0; }
00351   static const int min_exponent   VCL_STATIC_CONST_INIT_INT(-31);
00352   static const int min_exponent10 VCL_STATIC_CONST_INIT_INT(-9);
00353   static const int max_exponent   VCL_STATIC_CONST_INIT_INT(31);
00354   static const int max_exponent10 VCL_STATIC_CONST_INIT_INT(9);
00355   static const bool has_infinity      VCL_STATIC_CONST_INIT_INT(false);
00356   static const bool has_quiet_NaN     VCL_STATIC_CONST_INIT_INT(false);
00357   static const bool has_signaling_NaN VCL_STATIC_CONST_INIT_INT(false);
00358   static const bool has_denorm        VCL_STATIC_CONST_INIT_INT(false);
00359   static int infinity() { return max(); }
00360   static int quiet_NaN();
00361   static int signaling_NaN();
00362   inline static int denorm_min()    { return min(); }
00363   static const bool is_iec559  VCL_STATIC_CONST_INIT_INT(false);
00364   static const bool is_bounded VCL_STATIC_CONST_INIT_INT(true);
00365   static const bool is_modulo  VCL_STATIC_CONST_INIT_INT(true);
00366   static const bool traps      VCL_STATIC_CONST_INIT_INT(false);
00367   static const bool tinyness_before VCL_STATIC_CONST_INIT_INT(false);
00368   static const vnl_float_round_style round_style VCL_STATIC_CONST_INIT_INT(vnl_round_toward_zero);
00369 };
00370 
00371 VCL_DEFINE_SPECIALIZATION
00372 class vnl_numeric_limits<short > {
00373 public:
00374   static const bool is_specialized VCL_STATIC_CONST_INIT_INT(true);
00375   inline static int min() { return -0x7fff; }
00376   inline static int max() { return  0x7fff; }
00377   static const int digits   VCL_STATIC_CONST_INIT_INT(15);
00378   static const int digits10 VCL_STATIC_CONST_INIT_INT(5);
00379   static const bool is_signed  VCL_STATIC_CONST_INIT_INT(true);
00380   static const bool is_integer VCL_STATIC_CONST_INIT_INT(true);
00381   static const bool is_exact   VCL_STATIC_CONST_INIT_INT(true);
00382   static const int radix VCL_STATIC_CONST_INIT_INT(2);
00383   inline static int epsilon()     { return 0; }
00384   inline static int round_error() { return 0; }
00385   static const int min_exponent   VCL_STATIC_CONST_INIT_INT(-15);
00386   static const int min_exponent10 VCL_STATIC_CONST_INIT_INT(-5);
00387   static const int max_exponent   VCL_STATIC_CONST_INIT_INT(15);
00388   static const int max_exponent10 VCL_STATIC_CONST_INIT_INT(5);
00389   static const bool has_infinity      VCL_STATIC_CONST_INIT_INT(false);
00390   static const bool has_quiet_NaN     VCL_STATIC_CONST_INIT_INT(false);
00391   static const bool has_signaling_NaN VCL_STATIC_CONST_INIT_INT(false);
00392   static const bool has_denorm        VCL_STATIC_CONST_INIT_INT(false);
00393   static int infinity() { return max(); }
00394   static int quiet_NaN();
00395   static int signaling_NaN();
00396   inline static int denorm_min()    { return min(); }
00397   static const bool is_iec559  VCL_STATIC_CONST_INIT_INT(false);
00398   static const bool is_bounded VCL_STATIC_CONST_INIT_INT(true);
00399   static const bool is_modulo  VCL_STATIC_CONST_INIT_INT(true);
00400   static const bool traps      VCL_STATIC_CONST_INIT_INT(false);
00401   static const bool tinyness_before VCL_STATIC_CONST_INIT_INT(false);
00402   static const vnl_float_round_style round_style VCL_STATIC_CONST_INIT_INT(vnl_round_toward_zero);
00403 };
00404 
00405 // -------------------- #include <vnl/vnl_numeric_limits_float.h>
00406 
00407 // IEEE 754 single precision
00408 VCL_DEFINE_SPECIALIZATION
00409 class vnl_numeric_limits<float> {
00410 public:
00411   static const bool is_specialized VCL_STATIC_CONST_INIT_INT(true);
00412   inline static float min() { return 1.17549435E-38F; }
00413   inline static float max() { return 3.40282347E+38F; }
00414   static const int digits   VCL_STATIC_CONST_INIT_INT(24);
00415   static const int digits10 VCL_STATIC_CONST_INIT_INT(6);
00416   static const bool is_signed  VCL_STATIC_CONST_INIT_INT(true);
00417   static const bool is_integer VCL_STATIC_CONST_INIT_INT(false);
00418   static const bool is_exact   VCL_STATIC_CONST_INIT_INT(false);
00419   static const int radix VCL_STATIC_CONST_INIT_INT(2);
00420   inline static float epsilon()     { return 1.19209290E-07F; }
00421   inline static float round_error() { return 0.5F; }
00422   static const int min_exponent   VCL_STATIC_CONST_INIT_INT(-125);
00423   static const int min_exponent10 VCL_STATIC_CONST_INIT_INT(-37);
00424   static const int max_exponent   VCL_STATIC_CONST_INIT_INT(128);
00425   static const int max_exponent10 VCL_STATIC_CONST_INIT_INT(38);
00426   static const bool has_infinity      VCL_STATIC_CONST_INIT_INT(true);
00427   static const bool has_quiet_NaN     VCL_STATIC_CONST_INIT_INT(true);
00428   static const bool has_signaling_NaN VCL_STATIC_CONST_INIT_INT(true);
00429   static const bool has_denorm        VCL_STATIC_CONST_INIT_INT(false);
00430   static float infinity();
00431   static float quiet_NaN();
00432   static float signaling_NaN();
00433   inline static float denorm_min()    { return min(); }
00434   static const bool is_iec559  VCL_STATIC_CONST_INIT_INT(true);
00435   static const bool is_bounded VCL_STATIC_CONST_INIT_INT(true);
00436   static const bool is_modulo  VCL_STATIC_CONST_INIT_INT(false);
00437   static const bool traps      VCL_STATIC_CONST_INIT_INT(true);
00438   static const bool tinyness_before VCL_STATIC_CONST_INIT_INT(true);
00439   static const vnl_float_round_style round_style VCL_STATIC_CONST_INIT_INT(vnl_round_to_nearest);
00440 };
00441 
00442 // -------------------- #include <vnl/vnl_numeric_limits_double.h>
00443 
00444 // IEEE 754 double precision with denorm
00445 VCL_DEFINE_SPECIALIZATION
00446 class vnl_numeric_limits<double> {
00447 public:
00448   static const bool is_specialized VCL_STATIC_CONST_INIT_INT(true);
00449   inline static double min() { return 2.2250738585072014e-308; }
00450   inline static double max() { return 1.7976931348623157e+308; }
00451   static const int digits   VCL_STATIC_CONST_INIT_INT(53);
00452   static const int digits10 VCL_STATIC_CONST_INIT_INT(15);
00453   static const bool is_signed  VCL_STATIC_CONST_INIT_INT(true);
00454   static const bool is_integer VCL_STATIC_CONST_INIT_INT(false);
00455   static const bool is_exact   VCL_STATIC_CONST_INIT_INT(false);
00456   static const int radix VCL_STATIC_CONST_INIT_INT(2);
00457   inline static double epsilon()     { return 2.220446049250313e-16; }
00458   inline static double round_error() { return 0.5; }
00459   static const int min_exponent   VCL_STATIC_CONST_INIT_INT(-1021);
00460   static const int min_exponent10 VCL_STATIC_CONST_INIT_INT(-307);
00461   static const int max_exponent   VCL_STATIC_CONST_INIT_INT(1024);
00462   static const int max_exponent10 VCL_STATIC_CONST_INIT_INT(308);
00463   static const bool has_infinity      VCL_STATIC_CONST_INIT_INT(true);
00464   static const bool has_quiet_NaN     VCL_STATIC_CONST_INIT_INT(true);
00465   static const bool has_signaling_NaN VCL_STATIC_CONST_INIT_INT(true);
00466   static const bool has_denorm        VCL_STATIC_CONST_INIT_INT(false);
00467   static double infinity();
00468   static double quiet_NaN();
00469   static double signaling_NaN();
00470   inline static double denorm_min() { return /* 5e-324 */ min(); }
00471   static const bool is_iec559  VCL_STATIC_CONST_INIT_INT(true);
00472   static const bool is_bounded VCL_STATIC_CONST_INIT_INT(true);
00473   static const bool is_modulo  VCL_STATIC_CONST_INIT_INT(false);
00474   static const bool traps      VCL_STATIC_CONST_INIT_INT(true);
00475   static const bool tinyness_before VCL_STATIC_CONST_INIT_INT(true);
00476   static const vnl_float_round_style round_style VCL_STATIC_CONST_INIT_INT(vnl_round_to_nearest);
00477 };
00478 
00479 #endif // vnl_numeric_limits_h_

Generated at Wed Mar 12 01:13:15 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000