Lines 38-169
Link Here
|
38 |
#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) |
38 |
#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) |
39 |
void swap(mpq_class& x, mpq_class& y); |
39 |
void swap(mpq_class& x, mpq_class& y); |
40 |
|
40 |
|
41 |
namespace std { |
|
|
42 |
|
43 |
#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS |
44 |
//! Specialization of std::numeric_limits. |
45 |
#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) |
46 |
template <> |
47 |
class numeric_limits<mpz_class> { |
48 |
private: |
49 |
typedef mpz_class Type; |
50 |
|
51 |
public: |
52 |
static const bool is_specialized = true; |
53 |
static const int digits = 0; |
54 |
static const int digits10 = 0; |
55 |
static const bool is_signed = true; |
56 |
static const bool is_integer = true; |
57 |
static const bool is_exact = true; |
58 |
static const int radix = 2; |
59 |
static const int min_exponent = 0; |
60 |
static const int min_exponent10 = 0; |
61 |
static const int max_exponent = 0; |
62 |
static const int max_exponent10 = 0; |
63 |
static const bool has_infinity = false; |
64 |
static const bool has_quiet_NaN = false; |
65 |
static const bool has_signaling_NaN = false; |
66 |
static const float_denorm_style has_denorm = denorm_absent; |
67 |
static const bool has_denorm_loss = false; |
68 |
static const bool is_iec559 = false; |
69 |
static const bool is_bounded = false; |
70 |
static const bool is_modulo = false; |
71 |
static const bool traps = false; |
72 |
static const bool tininess_before = false; |
73 |
static const float_round_style round_style = round_toward_zero; |
74 |
|
75 |
static Type min() { |
76 |
return static_cast<Type>(0); |
77 |
} |
78 |
|
79 |
static Type max() { |
80 |
return static_cast<Type>(0); |
81 |
} |
82 |
|
83 |
static Type epsilon() { |
84 |
return static_cast<Type>(0); |
85 |
} |
86 |
|
87 |
static Type round_error() { |
88 |
return static_cast<Type>(0); |
89 |
} |
90 |
|
91 |
static Type infinity() { |
92 |
return static_cast<Type>(0); |
93 |
} |
94 |
|
95 |
static Type quiet_NaN() { |
96 |
return static_cast<Type>(0); |
97 |
} |
98 |
|
99 |
static Type denorm_min() { |
100 |
return static_cast<Type>(1); |
101 |
} |
102 |
}; |
103 |
|
104 |
#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS |
105 |
//! Specialization of std::numeric_limits. |
106 |
#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) |
107 |
template <> |
108 |
class numeric_limits<mpq_class> { |
109 |
private: |
110 |
typedef mpq_class Type; |
111 |
|
112 |
public: |
113 |
static const bool is_specialized = true; |
114 |
static const int digits = 0; |
115 |
static const int digits10 = 0; |
116 |
static const bool is_signed = true; |
117 |
static const bool is_integer = false; |
118 |
static const bool is_exact = true; |
119 |
static const int radix = 2; |
120 |
static const int min_exponent = 0; |
121 |
static const int min_exponent10 = 0; |
122 |
static const int max_exponent = 0; |
123 |
static const int max_exponent10 = 0; |
124 |
static const bool has_infinity = false; |
125 |
static const bool has_quiet_NaN = false; |
126 |
static const bool has_signaling_NaN = false; |
127 |
static const float_denorm_style has_denorm = denorm_absent; |
128 |
static const bool has_denorm_loss = false; |
129 |
static const bool is_iec559 = false; |
130 |
static const bool is_bounded = false; |
131 |
static const bool is_modulo = false; |
132 |
static const bool traps = false; |
133 |
static const bool tininess_before = false; |
134 |
static const float_round_style round_style = round_toward_zero; |
135 |
|
136 |
static Type min() { |
137 |
return static_cast<Type>(0); |
138 |
} |
139 |
|
140 |
static Type max() { |
141 |
return static_cast<Type>(0); |
142 |
} |
143 |
|
144 |
static Type epsilon() { |
145 |
return static_cast<Type>(0); |
146 |
} |
147 |
|
148 |
static Type round_error() { |
149 |
return static_cast<Type>(0); |
150 |
} |
151 |
|
152 |
static Type infinity() { |
153 |
return static_cast<Type>(0); |
154 |
} |
155 |
|
156 |
static Type quiet_NaN() { |
157 |
return static_cast<Type>(0); |
158 |
} |
159 |
|
160 |
static Type denorm_min() { |
161 |
return static_cast<Type>(0); |
162 |
} |
163 |
}; |
164 |
|
165 |
} // namespace std |
166 |
|
167 |
#include "mp_std_bits_inlines.hh" |
41 |
#include "mp_std_bits_inlines.hh" |
168 |
|
42 |
|
169 |
#endif // !defined(PPL_mp_std_bits_defs_hh) |
43 |
#endif // !defined(PPL_mp_std_bits_defs_hh) |