24 #ifndef PPL_math_utilities_inlines_hh
25 #define PPL_math_utilities_inlines_hh 1
28 #include "assertions.hh"
35 Coefficient_traits::const_reference y,
46 PPL_ASSERT(n <
unsigned(std::numeric_limits<T>::digits));
47 return ~((~static_cast<T>(0)) << n);
66 Coefficient_traits::const_reference x,
67 Coefficient_traits::const_reference y) {
102 template <
typename T>
112 if (x.get_den() <= 0) {
118 return temp.get_num() == x.get_num();
123 #endif // !defined(PPL_math_utilities_inlines_hh)
Enable_If< Is_Native_Or_Checked< To >::value &&Is_Special< From >::value, Result >::type assign_r(To &to, const From &, Rounding_Dir dir)
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_minus_infinity(const T &x)
The computed result is exact.
Enable_If< Is_Native_Or_Checked< T >::value, void >::type numer_denom(const T &from, Coefficient &numer, Coefficient &denom)
Extract the numerator and denominator components of from.
#define PPL_DIRTY_TEMP_COEFFICIENT(id)
Declare a local variable named id, of type Coefficient, and containing an unknown initial value...
void max_assign(N &x, const N &y)
Assigns to x the maximum between x and y.
void exact_div_assign(Checked_Number< T, Policy > &x, const Checked_Number< T, Policy > &y, const Checked_Number< T, Policy > &z)
T low_bits_mask(unsigned n)
Returns a mask for the lowest n bits,.
Enable_If< Is_Native_Or_Checked< T >::value, void >::type div_round_up(T &to, Coefficient_traits::const_reference x, Coefficient_traits::const_reference y)
Divides x by y into to, rounding the result towards plus infinity.
bool is_canonical(const mpq_class &x)
Returns true if and only if x is in canonical form.
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_even(const T &x)
Returns true if and only if x is an even number.
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_not_a_number(const T &x)
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_plus_infinity(const T &x)
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_additive_inverse(const T &x, const T &y)
Returns true if and only if .
#define PPL_DIRTY_TEMP(T, id)
The entire library is confined to this namespace.
void gcd_assign(GMP_Integer &x, const GMP_Integer &y, const GMP_Integer &z)
void normalize2(Coefficient_traits::const_reference x, Coefficient_traits::const_reference y, Coefficient &n_x, Coefficient &n_y)
If is the GCD of x and y, the values of x and y divided by are assigned to n_x and n_y...
void min_assign(N &x, const N &y)
Assigns to x the minimum between x and y.