24 #ifndef PPL_checked_defs_hh
25 #define PPL_checked_defs_hh 1
46 #define PPL_FUNCTION_CLASS(name) name ## _function_struct
48 #define PPL_DECLARE_FUN1_0_0(name, ret_type, qual, type) \
49 template <typename Policy, typename type> \
50 struct PPL_FUNCTION_CLASS(name); \
51 template <typename Policy, typename type> \
52 inline ret_type PPL_U(name)(PPL_U(qual) PPL_U(type)& arg) { \
53 return PPL_FUNCTION_CLASS(name)<Policy, PPL_U(type)>::function(arg); \
56 #define PPL_DECLARE_FUN1_0_1(name, ret_type, qual, type, after1) \
57 template <typename Policy, typename type> \
58 struct PPL_FUNCTION_CLASS(name); \
59 template <typename Policy, typename type> \
60 inline ret_type PPL_U(name)(PPL_U(qual) PPL_U(type)& arg, PPL_U(after1) a1) { \
62 PPL_FUNCTION_CLASS(name)<Policy, PPL_U(type)>::function(arg, a1); \
65 #define PPL_DECLARE_FUN1_0_2(name, ret_type, qual, type, after1, after2) \
66 template <typename Policy, typename type> \
67 struct PPL_FUNCTION_CLASS(name); \
68 template <typename Policy, typename type> \
69 inline ret_type PPL_U(name)(PPL_U(qual) PPL_U(type)& arg, PPL_U(after1) a1, \
72 PPL_FUNCTION_CLASS(name)<Policy, PPL_U(type)>::function(arg, \
76 #define PPL_DECLARE_FUN1_0_3(name, ret_type, qual, type, \
77 after1, after2, after3) \
78 template <typename Policy, typename type> \
79 struct PPL_FUNCTION_CLASS(name); \
80 template <typename Policy, typename type> \
81 inline ret_type PPL_U(name)(PPL_U(qual) PPL_U(type)& arg, \
82 PPL_U(after1) a1, PPL_U(after2) a2, \
85 PPL_FUNCTION_CLASS(name)<Policy, PPL_U(type)>::function(arg, \
90 #define PPL_DECLARE_FUN1_1_1(name, ret_type, before1, qual, type, after1) \
91 template <typename Policy, typename type> \
92 struct PPL_FUNCTION_CLASS(name); \
93 template <typename Policy, typename type> \
94 inline ret_type PPL_U(name)(PPL_U(before1) b1, PPL_U(qual) PPL_U(type)& arg, \
97 PPL_FUNCTION_CLASS(name)<Policy, PPL_U(type)>::function(b1, arg, \
101 #define PPL_DECLARE_FUN1_1_2(name, ret_type, before1, qual, type, \
103 template <typename Policy, typename type> \
104 struct PPL_FUNCTION_CLASS(name); \
105 template <typename Policy, typename type> \
106 inline ret_type PPL_U(name)(PPL_U(before1) b1, PPL_U(qual) PPL_U(type)& arg, \
107 PPL_U(after1) a1, PPL_U(after2) a2) { \
109 PPL_FUNCTION_CLASS(name)<Policy, PPL_U(type)>::function(b1, arg, \
113 #define PPL_DECLARE_FUN1_2_2(name, ret_type, before1, before2, qual, type, \
115 template <typename Policy, typename type> \
116 struct PPL_FUNCTION_CLASS(name); \
117 template <typename Policy, typename type> \
118 inline ret_type PPL_U(name)(PPL_U(before1) b1, PPL_U(before2) b2, \
119 PPL_U(qual) PPL_U(type)& arg, \
120 PPL_U(after1) a1, PPL_U(after2) a2) { \
122 PPL_FUNCTION_CLASS(name)<Policy, PPL_U(type)>::function(b1, b2, \
127 #define PPL_DECLARE_FUN2_0_0(name, ret_type, qual1, type1, qual2, type2) \
128 template <typename Policy1, typename Policy2, \
129 typename type1, typename type2> \
130 struct PPL_FUNCTION_CLASS(name); \
131 template <typename Policy1, typename Policy2, \
132 typename type1, typename type2> \
133 inline ret_type PPL_U(name)(PPL_U(qual1) PPL_U(type1)& arg1, \
134 PPL_U(qual2) PPL_U(type2)& arg2) { \
135 return PPL_FUNCTION_CLASS(name)<Policy1, Policy2, \
136 type1, PPL_U(type2)>::function(arg1, arg2); \
139 #define PPL_DECLARE_FUN2_0_1(name, ret_type, qual1, type1, \
140 qual2, type2, after1) \
141 template <typename Policy1, typename Policy2, \
142 typename type1, typename type2> \
143 struct PPL_FUNCTION_CLASS(name); \
144 template <typename Policy1, typename Policy2, \
145 typename type1, typename type2> \
146 inline ret_type PPL_U(name)(PPL_U(qual1) PPL_U(type1)& arg1, \
147 PPL_U(qual2) PPL_U(type2)& arg2, \
148 PPL_U(after1) a1) { \
149 return PPL_FUNCTION_CLASS(name)<Policy1, Policy2, \
150 type1, PPL_U(type2)>::function(arg1, arg2, a1); \
153 #define PPL_DECLARE_FUN2_0_2(name, ret_type, qual1, type1, qual2, type2, \
155 template <typename Policy1, typename Policy2, \
156 typename type1, typename type2> \
157 struct PPL_FUNCTION_CLASS(name); \
158 template <typename Policy1, typename Policy2, \
159 typename type1, typename type2> \
160 inline ret_type PPL_U(name)(PPL_U(qual1) PPL_U(type1)& arg1, \
161 PPL_U(qual2) PPL_U(type2)& arg2, \
162 PPL_U(after1) a1, PPL_U(after2) a2) { \
163 return PPL_FUNCTION_CLASS(name)<Policy1, Policy2, \
164 type1, PPL_U(type2)>::function(arg1, arg2, a1, a2); \
167 #define PPL_DECLARE_FUN3_0_1(name, ret_type, qual1, type1, \
168 qual2, type2, qual3, type3, after1) \
169 template <typename Policy1, typename Policy2, typename Policy3, \
170 typename type1, typename type2, typename type3> \
171 struct PPL_FUNCTION_CLASS(name); \
172 template <typename Policy1, typename Policy2, typename Policy3, \
173 typename type1, typename type2, typename type3> \
174 inline ret_type PPL_U(name)(PPL_U(qual1) PPL_U(type1)& arg1, \
175 PPL_U(qual2) PPL_U(type2)& arg2, \
176 PPL_U(qual3) PPL_U(type3)& arg3, \
177 PPL_U(after1) a1) { \
178 return PPL_FUNCTION_CLASS(name)<Policy1, Policy2, Policy3, \
179 type1, type2, PPL_U(type3)> \
180 ::function(arg1, arg2, arg3, a1); \
183 #define PPL_DECLARE_FUN5_0_1(name, ret_type, \
184 qual1, type1, qual2, type2, qual3, type3, \
185 qual4, type4, qual5, type5, \
187 template <typename Policy1, typename Policy2, typename Policy3, \
188 typename Policy4,typename Policy5, \
189 typename type1, typename type2, typename type3, \
190 typename type4, typename type5> \
191 struct PPL_FUNCTION_CLASS(name); \
192 template <typename Policy1, typename Policy2, typename Policy3, \
193 typename Policy4,typename Policy5, \
194 typename type1, typename type2, typename type3, \
195 typename type4, typename type5> \
196 inline ret_type PPL_U(name)(PPL_U(qual1) PPL_U(type1)& arg1, PPL_U(qual2) \
197 PPL_U(type2)& arg2, \
198 PPL_U(qual3) PPL_U(type3)& arg3, PPL_U(qual4) \
199 PPL_U(type4)& arg4, \
200 PPL_U(qual5) PPL_U(type5)& arg5, \
201 PPL_U(after1) a1) { \
202 return PPL_FUNCTION_CLASS(name)<Policy1, Policy2, Policy3, \
207 ::function(arg1, arg2, arg3, arg4, arg5, a1); \
210 #define PPL_SPECIALIZE_FUN1_0_0(name, func, ret_type, qual, type) \
211 template <typename Policy> \
212 struct PPL_FUNCTION_CLASS(name)<Policy, PPL_U(type)> { \
213 static inline ret_type function(PPL_U(qual) PPL_U(type)& arg) { \
214 return PPL_U(func)<Policy>(arg); \
218 #define PPL_SPECIALIZE_FUN1_0_1(name, func, ret_type, qual, type, after1) \
219 template <typename Policy> \
220 struct PPL_FUNCTION_CLASS(name)<Policy, PPL_U(type)> { \
221 static inline ret_type function(PPL_U(qual) PPL_U(type)& arg, \
222 PPL_U(after1) a1) { \
223 return PPL_U(func)<Policy>(arg, a1); \
227 #define PPL_SPECIALIZE_FUN1_0_2(name, func, ret_type, qual, type, \
229 template <typename Policy> \
230 struct PPL_FUNCTION_CLASS(name)<Policy, PPL_U(type)> { \
231 static inline ret_type function(PPL_U(qual) PPL_U(type)& arg, \
232 PPL_U(after1) a1, PPL_U(after2) a2) \
234 return PPL_U(func)<Policy>(arg, a1, a2); \
238 #define PPL_SPECIALIZE_FUN1_0_3(name, func, ret_type, qual, type, \
239 after1, after2, after3) \
240 template <typename Policy> \
241 struct PPL_FUNCTION_CLASS(name)<Policy, PPL_U(type)> { \
242 static inline ret_type function(PPL_U(qual) PPL_U(type)& arg, \
243 PPL_U(after1) a1, PPL_U(after2) a2, \
244 PPL_U(after3) a3) { \
245 return PPL_U(func)<Policy>(arg, a1, a2, a3); \
249 #define PPL_SPECIALIZE_FUN1_1_1(name, func, ret_type, before1, \
250 qual, type, after1) \
251 template <typename Policy> \
252 struct PPL_FUNCTION_CLASS(name)<Policy, PPL_U(type)> { \
253 static inline ret_type function(PPL_U(before1) b1, PPL_U(qual) \
255 PPL_U(after1) a1) { \
256 return PPL_U(func)<Policy>(b1, arg, a1); \
260 #define PPL_SPECIALIZE_FUN1_1_2(name, func, ret_type, before1, \
261 qual, type, after1, after2) \
262 template <typename Policy> \
263 struct PPL_FUNCTION_CLASS(name)<Policy, PPL_U(type)> { \
264 static inline ret_type function(PPL_U(before1) b1, PPL_U(qual) \
266 PPL_U(after1) a1, PPL_U(after2) a2) \
268 return PPL_U(func)<Policy>(b1, arg, a1, a2); \
272 #define PPL_SPECIALIZE_FUN1_2_2(name, func, ret_type, before1, before2, \
273 qual, type, after1, after2) \
274 template <typename Policy> \
275 struct PPL_FUNCTION_CLASS(name)<Policy, PPL_U(type)> { \
276 static inline ret_type function(PPL_U(before1) b1, PPL_U(before2) b2, \
277 PPL_U(qual) PPL_U(type)& arg, \
278 PPL_U(after1) a1, PPL_U(after2) a2) \
280 return PPL_U(func)<Policy>(b1, b2, arg, a1, a2); \
284 #define PPL_SPECIALIZE_FUN2_0_0(name, func, ret_type, qual1, type1, \
286 template <typename Policy1, typename Policy2> \
287 struct PPL_FUNCTION_CLASS(name)<Policy1, Policy2, type1, \
289 static inline ret_type function(PPL_U(qual1) PPL_U(type1)& arg1, \
290 PPL_U(qual2) PPL_U(type2) &arg2) { \
291 return PPL_U(func)<Policy1, Policy2>(arg1, arg2); \
295 #define PPL_SPECIALIZE_FUN2_0_1(name, func, ret_type, qual1, type1, \
296 qual2, type2, after1) \
297 template <typename Policy1, typename Policy2> \
298 struct PPL_FUNCTION_CLASS(name)<Policy1, Policy2, type1, \
300 static inline ret_type function(PPL_U(qual1) PPL_U(type1)& arg1, \
301 PPL_U(qual2) PPL_U(type2) &arg2, \
302 PPL_U(after1) a1) { \
303 return PPL_U(func)<Policy1, Policy2>(arg1, arg2, a1); \
307 #define PPL_SPECIALIZE_FUN2_0_2(name, func, ret_type, qual1, type1, \
308 qual2, type2, after1, after2) \
309 template <typename Policy1, typename Policy2> \
310 struct PPL_FUNCTION_CLASS(name)<Policy1, Policy2, type1, \
312 static inline ret_type function(PPL_U(qual1) PPL_U(type1)& arg1, \
313 PPL_U(qual2) PPL_U(type2) &arg2, \
314 PPL_U(after1) a1, PPL_U(after2) a2) \
316 return PPL_U(func)<Policy1, Policy2>(arg1, arg2, a1, a2); \
320 #define PPL_SPECIALIZE_FUN3_0_1(name, func, ret_type, qual1, type1, \
321 qual2, type2, qual3, type3, after1) \
322 template <typename Policy1, typename Policy2, typename Policy3> \
323 struct PPL_FUNCTION_CLASS(name) <Policy1, Policy2, Policy3, \
326 static inline Result function(PPL_U(qual1) PPL_U(type1)& arg1, \
327 PPL_U(qual2) PPL_U(type2) &arg2, \
328 PPL_U(qual3) PPL_U(type3) &arg3, \
329 PPL_U(after1) a1) { \
330 return PPL_U(func)<Policy1, Policy2, Policy3>(arg1, arg2, arg3, \
335 #define PPL_SPECIALIZE_FUN5_0_1(name, func, ret_type, \
336 qual1, type1, qual2, type2, \
338 qual4, type4, qual5, type5, after1) \
339 template <typename Policy1, typename Policy2, typename Policy3, \
340 typename Policy4, typename Policy5> \
341 struct PPL_FUNCTION_CLASS(name) <Policy1, Policy2, Policy3, Policy4, \
346 static inline Result \
347 function(PPL_U(qual1) PPL_U(type1)& arg1, PPL_U(qual2) \
348 PPL_U(type2) &arg2, \
349 PPL_U(qual3) PPL_U(type3) &arg3, PPL_U(qual4) \
350 PPL_U(type4) &arg4, \
351 PPL_U(qual5) PPL_U(type5) &arg5, PPL_U(after1) a1) { \
352 return PPL_U(func)<Policy1, Policy2, Policy3, Policy4, \
353 Policy5>(arg1, arg2, arg3, arg4, arg5, a1); \
359 #define PPL_SAVED_nonconst nonconst
364 #define PPL_SPECIALIZE_COPY(func, Type) \
365 PPL_SPECIALIZE_FUN2_0_0(copy, func, void, nonconst, Type, const, Type)
366 #define PPL_SPECIALIZE_SGN(func, From) \
367 PPL_SPECIALIZE_FUN1_0_0(sgn, func, Result_Relation, const, From)
368 #define PPL_SPECIALIZE_CMP(func, Type1, Type2) \
369 PPL_SPECIALIZE_FUN2_0_0(cmp, func, Result_Relation, const, Type1, const, Type2)
370 #define PPL_SPECIALIZE_CLASSIFY(func, Type) \
371 PPL_SPECIALIZE_FUN1_0_3(classify, func, Result, const, Type, bool, bool, bool)
372 #define PPL_SPECIALIZE_IS_NAN(func, Type) \
373 PPL_SPECIALIZE_FUN1_0_0(is_nan, func, bool, const, Type)
374 #define PPL_SPECIALIZE_IS_MINF(func, Type) \
375 PPL_SPECIALIZE_FUN1_0_0(is_minf, func, bool, const, Type)
376 #define PPL_SPECIALIZE_IS_PINF(func, Type) \
377 PPL_SPECIALIZE_FUN1_0_0(is_pinf, func, bool, const, Type)
378 #define PPL_SPECIALIZE_IS_INT(func, Type) \
379 PPL_SPECIALIZE_FUN1_0_0(is_int, func, bool, const, Type)
380 #define PPL_SPECIALIZE_ASSIGN_SPECIAL(func, Type) \
381 PPL_SPECIALIZE_FUN1_0_2(assign_special, func, Result, \
382 nonconst, Type, Result_Class, Rounding_Dir)
383 #define PPL_SPECIALIZE_CONSTRUCT_SPECIAL(func, Type) \
384 PPL_SPECIALIZE_FUN1_0_2(construct_special, func, Result, nonconst, \
385 Type, Result_Class, Rounding_Dir)
386 #define PPL_SPECIALIZE_CONSTRUCT(func, To, From) \
387 PPL_SPECIALIZE_FUN2_0_1(construct, func, Result, nonconst, To, \
388 const, From, Rounding_Dir)
389 #define PPL_SPECIALIZE_ASSIGN(func, To, From) \
390 PPL_SPECIALIZE_FUN2_0_1(assign, func, Result, nonconst, To, \
391 const, From, Rounding_Dir)
392 #define PPL_SPECIALIZE_FLOOR(func, To, From) \
393 PPL_SPECIALIZE_FUN2_0_1(floor, func, Result, nonconst, To, \
394 const, From, Rounding_Dir)
395 #define PPL_SPECIALIZE_CEIL(func, To, From) \
396 PPL_SPECIALIZE_FUN2_0_1(ceil, func, Result, nonconst, To, \
397 const, From, Rounding_Dir)
398 #define PPL_SPECIALIZE_TRUNC(func, To, From) \
399 PPL_SPECIALIZE_FUN2_0_1(trunc, func, Result, nonconst, To, \
400 const, From, Rounding_Dir)
401 #define PPL_SPECIALIZE_NEG(func, To, From) \
402 PPL_SPECIALIZE_FUN2_0_1(neg, func, Result, nonconst, To, \
403 const, From, Rounding_Dir)
404 #define PPL_SPECIALIZE_ABS(func, To, From) \
405 PPL_SPECIALIZE_FUN2_0_1(abs, func, Result, nonconst, To, \
406 const, From, Rounding_Dir)
407 #define PPL_SPECIALIZE_SQRT(func, To, From) \
408 PPL_SPECIALIZE_FUN2_0_1(sqrt, func, Result, nonconst, To, \
409 const, From, Rounding_Dir)
410 #define PPL_SPECIALIZE_ADD(func, To, From1, From2) \
411 PPL_SPECIALIZE_FUN3_0_1(add, func, Result, nonconst, To, \
412 const, From1, const, From2, Rounding_Dir)
413 #define PPL_SPECIALIZE_SUB(func, To, From1, From2) \
414 PPL_SPECIALIZE_FUN3_0_1(sub, func, Result, nonconst, To, \
415 const, From1, const, From2, Rounding_Dir)
416 #define PPL_SPECIALIZE_MUL(func, To, From1, From2) \
417 PPL_SPECIALIZE_FUN3_0_1(mul, func, Result, nonconst, To, \
418 const, From1, const, From2, Rounding_Dir)
419 #define PPL_SPECIALIZE_DIV(func, To, From1, From2) \
420 PPL_SPECIALIZE_FUN3_0_1(div, func, Result, nonconst, To, \
421 const, From1, const, From2, Rounding_Dir)
422 #define PPL_SPECIALIZE_REM(func, To, From1, From2) \
423 PPL_SPECIALIZE_FUN3_0_1(rem, func, Result, nonconst, To, \
424 const, From1, const, From2, Rounding_Dir)
425 #define PPL_SPECIALIZE_IDIV(func, To, From1, From2) \
426 PPL_SPECIALIZE_FUN3_0_1(idiv, func, Result, nonconst, To, \
427 const, From1, const, From2, Rounding_Dir)
428 #define PPL_SPECIALIZE_ADD_2EXP(func, To, From) \
429 PPL_SPECIALIZE_FUN2_0_2(add_2exp, func, Result, nonconst, To, \
430 const, From, unsigned int, Rounding_Dir)
431 #define PPL_SPECIALIZE_SUB_2EXP(func, To, From) \
432 PPL_SPECIALIZE_FUN2_0_2(sub_2exp, func, Result, nonconst, To, \
433 const, From, unsigned int, Rounding_Dir)
434 #define PPL_SPECIALIZE_MUL_2EXP(func, To, From) \
435 PPL_SPECIALIZE_FUN2_0_2(mul_2exp, func, Result, nonconst, To, \
436 const, From, unsigned int, Rounding_Dir)
437 #define PPL_SPECIALIZE_DIV_2EXP(func, To, From) \
438 PPL_SPECIALIZE_FUN2_0_2(div_2exp, func, Result, nonconst, To, \
439 const, From, unsigned int, Rounding_Dir)
440 #define PPL_SPECIALIZE_SMOD_2EXP(func, To, From) \
441 PPL_SPECIALIZE_FUN2_0_2(smod_2exp, func, Result, nonconst, To, \
442 const, From, unsigned int, Rounding_Dir)
443 #define PPL_SPECIALIZE_UMOD_2EXP(func, To, From) \
444 PPL_SPECIALIZE_FUN2_0_2(umod_2exp, func, Result, nonconst, To, \
445 const, From, unsigned int, Rounding_Dir)
446 #define PPL_SPECIALIZE_ADD_MUL(func, To, From1, From2) \
447 PPL_SPECIALIZE_FUN3_0_1(add_mul, func, Result, nonconst, To, \
448 const, From1, const, From2, Rounding_Dir)
449 #define PPL_SPECIALIZE_SUB_MUL(func, To, From1, From2) \
450 PPL_SPECIALIZE_FUN3_0_1(sub_mul, func, Result, nonconst, To, \
451 const, From1, const, From2, Rounding_Dir)
452 #define PPL_SPECIALIZE_GCD(func, To, From1, From2) \
453 PPL_SPECIALIZE_FUN3_0_1(gcd, func, Result, nonconst, To, \
454 const, From1, const, From2, Rounding_Dir)
455 #define PPL_SPECIALIZE_GCDEXT(func, To1, From1, From2, To2, To3) \
456 PPL_SPECIALIZE_FUN5_0_1(gcdext, func, Result, nonconst, To1, \
457 nonconst, To2, nonconst, To3, \
458 const, From1, const, From2, Rounding_Dir)
459 #define PPL_SPECIALIZE_LCM(func, To, From1, From2) \
460 PPL_SPECIALIZE_FUN3_0_1(lcm, func, Result, nonconst, To, \
461 const, From1, const, From2, Rounding_Dir)
462 #define PPL_SPECIALIZE_INPUT(func, Type) \
463 PPL_SPECIALIZE_FUN1_0_2(input, func, Result, nonconst, Type, \
464 std::istream&, Rounding_Dir)
465 #define PPL_SPECIALIZE_OUTPUT(func, Type) \
466 PPL_SPECIALIZE_FUN1_1_2(output, func, Result, std::ostream&, \
468 const Numeric_Format&, Rounding_Dir)
472 void,
nonconst, Type1,
const, Type2)
508 Result, nonconst, To,
511 Result, nonconst, To,
514 Result, nonconst, To,
517 Result, nonconst, To,
520 Result, nonconst, To,
523 Result, nonconst, To,
526 Result, nonconst, To,
529 Result, nonconst, To,
532 Result, nonconst, To,
535 Result, nonconst, To,
538 Result, nonconst, To,
541 Result, nonconst, To,
544 Result, nonconst, To,
547 Result, nonconst, To,
550 Result, nonconst, To,
556 Result, nonconst, To,
561 Result,
std::ostream&, const, Type,
564 #undef PPL_DECLARE_FUN1_0_0
565 #undef PPL_DECLARE_FUN1_0_1
566 #undef PPL_DECLARE_FUN1_0_2
567 #undef PPL_DECLARE_FUN1_0_3
568 #undef PPL_DECLARE_FUN1_1_1
569 #undef PPL_DECLARE_FUN1_1_2
570 #undef PPL_DECLARE_FUN1_2_2
571 #undef PPL_DECLARE_FUN2_0_0
572 #undef PPL_DECLARE_FUN2_0_1
573 #undef PPL_DECLARE_FUN2_0_2
574 #undef PPL_DECLARE_FUN3_0_1
575 #undef PPL_DECLARE_FUN5_0_1
577 template <
typename Policy,
typename To>
580 Result
input_mpq(mpq_class& to, std::istream& is);
596 template <
typename T>
612 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
614 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
615 template <
typename T>
698 #define CHECK_P(cond, check) ((cond) ? (check) : (assert(!(check)), false))
708 #ifdef PPL_SAVED_nonconst
709 #define nonconst PPL_SAVED_nonconst
710 #undef PPL_SAVED_nonconst
713 #undef PPL_FUNCTION_CLASS
716 #endif // !defined(PPL_checked_defs_hh)
From bool PPL_DECLARE_FUN1_0_0(is_nan, bool, const, Type) PPL_DECLARE_FUN1_0_0(is_minf
Rounding_Dir
Rounding directions for arithmetic computations.
std::string float_mpq_to_string(mpq_class &q)
static const Result_Class vclass
Not_A_Number NOT_A_NUMBER
Result
Possible outcomes of a checked arithmetic computation.
From bool Type Type Rounding_Dir To
The standard C++ namespace.
int fpu_check_inexact()
Queries the inexact computation status.
Negative infinity result class.
Not a number result class.
static const Rounding_Dir ROUND_DEFAULT_OUTPUT
For output functions, by default use the same rounding used by the underlying type.
static const Rounding_Dir ROUND_DEFAULT_INPUT
For input functions, by default use the same rounding used by the underlying type.
Result assign(Boundary_Type to_type, To &to, To_Info &to_info, Boundary_Type type, const T &x, const Info &info, bool should_shrink=false)
From bool Type Type Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir unsigned Rounding_Dir unsigned Rounding_Dir unsigned Rounding_Dir Rounding_Dir To2
PPL_DECLARE_FUN2_0_0(copy, void, nonconst, Type1, const, Type2) PPL_DECLARE_FUN1_0_0(sgn
Positive infinity result class.
From bool Type Type nonconst
A class holding a constant called value that evaluates to true.
From bool Type Type Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir unsigned Rounding_Dir unsigned Rounding_Dir unsigned Rounding_Dir Rounding_Dir Rounding_Dir std::istream Rounding_Dir To Result round(To &to, Result r, Rounding_Dir dir)
From bool Type Type Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir unsigned Rounding_Dir unsigned Rounding_Dir unsigned Rounding_Dir Rounding_Dir To1
static const Rounding_Dir ROUND_DEFAULT_FUNCTION
For all other functions, by default use the same rounding used by the underlying type.
From bool Type Type Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir From1
static const Result_Class vclass
Plus_Infinity PLUS_INFINITY
The entire library is confined to this namespace.
From bool Type Type Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir unsigned Rounding_Dir unsigned Rounding_Dir unsigned Rounding_Dir Rounding_Dir Rounding_Dir std::istream Rounding_Dir PPL_DECLARE_FUN1_1_2(output, Result, std::ostream &, const, Type, const Numeric_Format &, Rounding_Dir) template< typename Policy
static void handle_result(Result r)
Handles r: called by all constructors, operators and functions that do not return a Result value...
Minus_Infinity MINUS_INFINITY
int cmp(const GMP_Integer &x, const GMP_Integer &y)
const_bool_nodef(check_overflow, false)
Do not check for overflowed result.
From bool Type Type Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir From2
From bool Type Type Rounding_Dir From
Result input_mpq(mpq_class &to, std::istream &is)
int sgn(Boundary_Type type, const T &x, const Info &info)
static const Rounding_Dir ROUND_DEFAULT_OPERATOR
For overloaded operators (operator+(), operator-(), ...), by default use the same rounding used by th...
#define PPL_DECLARE_FUN1_0_3(name, ret_type, qual, type, after1, after2, after3)
From bool Type Type PPL_DECLARE_FUN1_0_2(assign_special, Result, nonconst, Type, Result_Class, Rounding_Dir) PPL_DECLARE_FUN1_0_2(construct_special
static const Rounding_Dir ROUND_DEFAULT_CONSTRUCTOR
For constructors, by default use the same rounding used by underlying type.
Enable_If< Is_Native_Or_Checked< To >::value &&Is_Special< From >::value, Result >::type construct(To &to, const From &, Rounding_Dir dir)
A class holding a constant called value that evaluates to false.
static const Result_Class vclass
From bool Type Type Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir PPL_DECLARE_FUN3_0_1(add, Result, nonconst, To, const, From1, const, From2, Rounding_Dir) PPL_DECLARE_FUN3_0_1(sub
From bool Type Type Rounding_Dir PPL_DECLARE_FUN2_0_1(construct, Result, nonconst, To, const, From, Rounding_Dir) PPL_DECLARE_FUN2_0_1(assign
#define PPL_DECLARE_FUN5_0_1(name, ret_type, qual1, type1, qual2, type2, qual3, type3, qual4, type4, qual5, type5, after1)
From bool Type Type Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir unsigned Rounding_Dir unsigned Rounding_Dir unsigned Rounding_Dir Rounding_Dir To3
From bool Type Type Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir Rounding_Dir PPL_DECLARE_FUN2_0_2(add_2exp, Result, nonconst, To, const, From, unsigned int, Rounding_Dir) PPL_DECLARE_FUN2_0_2(sub_2exp