]> AND Private Git Repository - canny.git/blob - stc/exp/ml_stc_linux_make_v1.0/include/boost/limits.hpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
37f72174d42973b0d3bb28db7fc1845cb4f814bd
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / limits.hpp
1 \r
2 //  (C) Copyright John maddock 1999. \r
3 //  (C) David Abrahams 2002.  Distributed under the Boost\r
4 //  Software License, Version 1.0. (See accompanying file\r
5 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
6 //\r
7 // use this header as a workaround for missing <limits>\r
8 \r
9 //  See http://www.boost.org/libs/compatibility/index.html for documentation.\r
10 \r
11 #ifndef BOOST_LIMITS\r
12 #define BOOST_LIMITS\r
13 \r
14 #include <boost/config.hpp>\r
15 \r
16 #ifdef BOOST_NO_LIMITS\r
17 # include <boost/detail/limits.hpp>\r
18 #else\r
19 # include <limits>\r
20 #endif\r
21 \r
22 #if (defined(BOOST_HAS_LONG_LONG) && defined(BOOST_NO_LONG_LONG_NUMERIC_LIMITS)) \\r
23       || (defined(BOOST_HAS_MS_INT64) && defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS))\r
24 // Add missing specializations for numeric_limits:\r
25 #ifdef BOOST_HAS_MS_INT64\r
26 #  define BOOST_LLT __int64\r
27 #  define BOOST_ULLT unsigned __int64\r
28 #else\r
29 #  define BOOST_LLT  ::boost::long_long_type\r
30 #  define BOOST_ULLT  ::boost::ulong_long_type\r
31 #endif\r
32 \r
33 #include <climits>  // for CHAR_BIT\r
34 \r
35 namespace std\r
36 {\r
37   template<>\r
38   class numeric_limits<BOOST_LLT> \r
39   {\r
40    public:\r
41 \r
42       BOOST_STATIC_CONSTANT(bool, is_specialized = true);\r
43 #ifdef BOOST_HAS_MS_INT64\r
44       static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0x8000000000000000i64; }\r
45       static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0x7FFFFFFFFFFFFFFFi64; }\r
46 #elif defined(LLONG_MAX)\r
47       static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LLONG_MIN; }\r
48       static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LLONG_MAX; }\r
49 #elif defined(LONGLONG_MAX)\r
50       static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LONGLONG_MIN; }\r
51       static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LONGLONG_MAX; }\r
52 #else\r
53       static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 1LL << (sizeof(BOOST_LLT) * CHAR_BIT - 1); }\r
54       static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ~(min)(); }\r
55 #endif\r
56       BOOST_STATIC_CONSTANT(int, digits = sizeof(BOOST_LLT) * CHAR_BIT -1);\r
57       BOOST_STATIC_CONSTANT(int, digits10 = (CHAR_BIT * sizeof (BOOST_LLT) - 1) * 301L / 1000);\r
58       BOOST_STATIC_CONSTANT(bool, is_signed = true);\r
59       BOOST_STATIC_CONSTANT(bool, is_integer = true);\r
60       BOOST_STATIC_CONSTANT(bool, is_exact = true);\r
61       BOOST_STATIC_CONSTANT(int, radix = 2);\r
62       static BOOST_LLT epsilon() throw() { return 0; };\r
63       static BOOST_LLT round_error() throw() { return 0; };\r
64 \r
65       BOOST_STATIC_CONSTANT(int, min_exponent = 0);\r
66       BOOST_STATIC_CONSTANT(int, min_exponent10 = 0);\r
67       BOOST_STATIC_CONSTANT(int, max_exponent = 0);\r
68       BOOST_STATIC_CONSTANT(int, max_exponent10 = 0);\r
69 \r
70       BOOST_STATIC_CONSTANT(bool, has_infinity = false);\r
71       BOOST_STATIC_CONSTANT(bool, has_quiet_NaN = false);\r
72       BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false);\r
73       BOOST_STATIC_CONSTANT(bool, has_denorm = false);\r
74       BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false);\r
75       static BOOST_LLT infinity() throw() { return 0; };\r
76       static BOOST_LLT quiet_NaN() throw() { return 0; };\r
77       static BOOST_LLT signaling_NaN() throw() { return 0; };\r
78       static BOOST_LLT denorm_min() throw() { return 0; };\r
79 \r
80       BOOST_STATIC_CONSTANT(bool, is_iec559 = false);\r
81       BOOST_STATIC_CONSTANT(bool, is_bounded = true);\r
82       BOOST_STATIC_CONSTANT(bool, is_modulo = true);\r
83 \r
84       BOOST_STATIC_CONSTANT(bool, traps = false);\r
85       BOOST_STATIC_CONSTANT(bool, tinyness_before = false);\r
86       BOOST_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero);\r
87       \r
88   };\r
89 \r
90   template<>\r
91   class numeric_limits<BOOST_ULLT> \r
92   {\r
93    public:\r
94 \r
95       BOOST_STATIC_CONSTANT(bool, is_specialized = true);\r
96 #ifdef BOOST_HAS_MS_INT64\r
97       static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0ui64; }\r
98       static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0xFFFFFFFFFFFFFFFFui64; }\r
99 #elif defined(ULLONG_MAX) && defined(ULLONG_MIN)\r
100       static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULLONG_MIN; }\r
101       static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULLONG_MAX; }\r
102 #elif defined(ULONGLONG_MAX) && defined(ULONGLONG_MIN)\r
103       static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULONGLONG_MIN; }\r
104       static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULONGLONG_MAX; }\r
105 #else\r
106       static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0uLL; }\r
107       static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ~0uLL; }\r
108 #endif\r
109       BOOST_STATIC_CONSTANT(int, digits = sizeof(BOOST_LLT) * CHAR_BIT);\r
110       BOOST_STATIC_CONSTANT(int, digits10 = (CHAR_BIT * sizeof (BOOST_LLT)) * 301L / 1000);\r
111       BOOST_STATIC_CONSTANT(bool, is_signed = false);\r
112       BOOST_STATIC_CONSTANT(bool, is_integer = true);\r
113       BOOST_STATIC_CONSTANT(bool, is_exact = true);\r
114       BOOST_STATIC_CONSTANT(int, radix = 2);\r
115       static BOOST_ULLT epsilon() throw() { return 0; };\r
116       static BOOST_ULLT round_error() throw() { return 0; };\r
117 \r
118       BOOST_STATIC_CONSTANT(int, min_exponent = 0);\r
119       BOOST_STATIC_CONSTANT(int, min_exponent10 = 0);\r
120       BOOST_STATIC_CONSTANT(int, max_exponent = 0);\r
121       BOOST_STATIC_CONSTANT(int, max_exponent10 = 0);\r
122 \r
123       BOOST_STATIC_CONSTANT(bool, has_infinity = false);\r
124       BOOST_STATIC_CONSTANT(bool, has_quiet_NaN = false);\r
125       BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false);\r
126       BOOST_STATIC_CONSTANT(bool, has_denorm = false);\r
127       BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false);\r
128       static BOOST_ULLT infinity() throw() { return 0; };\r
129       static BOOST_ULLT quiet_NaN() throw() { return 0; };\r
130       static BOOST_ULLT signaling_NaN() throw() { return 0; };\r
131       static BOOST_ULLT denorm_min() throw() { return 0; };\r
132 \r
133       BOOST_STATIC_CONSTANT(bool, is_iec559 = false);\r
134       BOOST_STATIC_CONSTANT(bool, is_bounded = true);\r
135       BOOST_STATIC_CONSTANT(bool, is_modulo = true);\r
136 \r
137       BOOST_STATIC_CONSTANT(bool, traps = false);\r
138       BOOST_STATIC_CONSTANT(bool, tinyness_before = false);\r
139       BOOST_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero);\r
140       \r
141   };\r
142 }\r
143 #endif \r
144 \r
145 #endif\r
146 \r