Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

more/math/limits.h

Go to the documentation of this file.
00001 #ifndef MORE_LIMITS_H
00002 #define MORE_LIMITS_H
00003 
00004 #include <limits>
00005 
00006 namespace more {
00007 
00008   template<typename T>
00009     struct numeric_limits : std::numeric_limits<T> {};
00010 #ifdef CXX_HAVE_LONG_LONG
00011   struct numeric_limits<long long> {
00012       static const bool is_specialized = true;
00013       // XXX don't know if min and max below works.
00014       static long long min() throw() { return -(1L<<8*sizeof(long long)-1); }
00015       static long long max() throw() { return (1L<<8*sizeof(long long)-1)-1L; }
00016       static const int  digits = 8*sizeof(long long)-1;
00017       static const int  digits10 = 19*digits/64; // approximately
00018       static const bool is_signed = true;
00019       static const bool is_integer = true;
00020       static const bool is_exact = true;
00021       static const int  radix = 2;
00022       static long long epsilon() throw() { return 0; }
00023       static long long round_error() throw() { return 0; }
00024 
00025       static const int  min_exponent = 0;
00026       static const int  min_exponent10 = 0;
00027       static const int  max_exponent = 0;
00028       static const int  max_exponent10 = 0;
00029 
00030       static const bool has_infinity = false;
00031       static const bool has_quiet_NaN = false;
00032       static const bool has_signaling_NaN = false;
00033       static const std::float_denorm_style has_denorm = std::denorm_absent;
00034       static const bool has_denorm_loss = false;
00035       static long long infinity() throw() { return 0; }
00036       static long long quiet_NaN() throw() { return 0; }
00037       static long long signaling_NaN() throw() { return 0; }
00038       static long long denorm_min() throw() { return 0; }
00039 
00040       static const bool is_iec559 = false; // XXX ???
00041       static const bool is_bounded = true;
00042       static const bool is_modulo = true;
00043 
00044       static const bool traps = false; // XXX ???
00045       static const bool tinyness_before = false;
00046       static const float_round_style round_style = round_toward_zero;
00047   };
00048 
00049   struct numeric_limits<unsigned long long> {
00050       static const bool is_specialized = true;
00051       // XXX don't know if min and max below works.
00052       static unsigned long long min() throw()
00053       { return 0; }
00054       static unsigned long long max() throw()
00055       { return (((unsigned long long)1L) << 8*sizeof(unsigned long long))-1; }
00056       static const int  digits = 8*sizeof(unsigned long long);
00057       static const int  digits10 = 19*digits/64; // approximately
00058       static const bool is_signed = false;
00059       static const bool is_integer = true;
00060       static const bool is_exact = true;
00061       static const int  radix = 2;
00062       static unsigned long long epsilon() throw() { return 0; }
00063       static unsigned long long round_error() throw() { return 0; }
00064 
00065       static const int  min_exponent = 0;
00066       static const int  min_exponent10 = 0;
00067       static const int  max_exponent = 0;
00068       static const int  max_exponent10 = 0;
00069 
00070       static const bool has_infinity = false;
00071       static const bool has_quiet_NaN = false;
00072       static const bool has_signaling_NaN = false;
00073       static const std::float_denorm_style has_denorm = std::denorm_absent;
00074       static const bool has_denorm_loss = false;
00075       static unsigned long long infinity() throw() { return 0; }
00076       static unsigned long long quiet_NaN() throw() { return 0; }
00077       static unsigned long long signaling_NaN() throw() { return 0; }
00078       static unsigned long long denorm_min() throw() { return 0; }
00079 
00080       static const bool is_iec559 = false; // XXX ???
00081       static const bool is_bounded = true;
00082       static const bool is_modulo = true;
00083 
00084       static const bool traps = false; // XXX ???
00085       static const bool tinyness_before = false;
00086       static const float_round_style round_style = round_toward_zero;
00087   };
00088 #endif
00089 
00090 }
00091 
00092 
00093 #endif

Generated on Sat Sep 7 19:11:18 2002 for more with Doxygen 1.2.13.1. Doxygen 1.2.13.1 is written and copyright 1997-2002 by Dimitri van Heesch.