Lines Matching refs:den
181 rational() : num(0), den(1) {} in rational()
186 >::type const* = 0) : num(n), den(1) {} in rational()
191 >::type const* = 0) : num(n), den(d) { in rational()
198 : num(r.numerator()), den(is_normalized(int_type(r.numerator()), in rational()
205 : num(r.numerator()), den(is_normalized(int_type(r.numerator()), in rational()
284 const IntType& denominator() const { return den; } in denominator()
295 num += i * den; in operator +=()
301 num -= i * den; in operator -=()
308 IntType gcd = integer::gcd(static_cast<IntType>(i), den); in operator *=()
310 den /= gcd; in operator *=()
325 den *= i / gcd; in operator /=()
327 if(den < zero) { in operator /=()
329 den = -den; in operator /=()
336 BOOST_CXX14_CONSTEXPR const rational& operator++() { num += den; return *this; } in operator ++()
337 BOOST_CXX14_CONSTEXPR const rational& operator--() { num -= den; return *this; } in operator --()
385 BOOST_ASSERT(this->den > zero); in operator <()
386 int_type q = this->num / this->den, r = this->num % this->den; in operator <()
387 while(r < zero) { r += this->den; --q; } in operator <()
403 return ((den == IntType(1)) && (num == i)); in operator ==()
410 IntType den; member in boost::rational
539 IntType r_den = r.den; in operator +=()
541 IntType g = integer::gcd(den, r_den); in operator +=()
542 den /= g; // = b1 from the calculations above in operator +=()
543 num = num * (r_den / g) + r_num * den; in operator +=()
546 den *= r_den/g; in operator +=()
556 IntType r_den = r.den; in operator -=()
560 IntType g = integer::gcd(den, r_den); in operator -=()
561 den /= g; in operator -=()
562 num = num * (r_den / g) - r_num * den; in operator -=()
565 den *= r_den/g; in operator -=()
575 IntType r_den = r.den; in operator *=()
579 IntType gcd2 = integer::gcd(r_num, den); in operator *=()
581 den = (den/gcd2) * (r_den/gcd1); in operator *=()
590 IntType r_den = r.den; in operator /=()
603 IntType gcd2 = integer::gcd(r_den, den); in operator /=()
605 den = (den/gcd2) * (r_num/gcd1); in operator /=()
607 if (den < zero) { in operator /=()
609 den = -den; in operator /=()
794 BOOST_ASSERT( this->den > zero ); in operator <()
795 BOOST_ASSERT( r.den > zero ); in operator <()
800 ts = { this->num, this->den, static_cast<int_type>(this->num / this->den), in operator <()
801 static_cast<int_type>(this->num % this->den) }, in operator <()
802 rs = { r.num, r.den, static_cast<int_type>(r.num / r.den), in operator <()
803 static_cast<int_type>(r.num % r.den) }; in operator <()
872 return ((num == r.num) && (den == r.den)); in operator ==()
880 return ( this->den > int_type(0) ) && ( integer::gcd(this->num, this->den) == in test_invariant()
891 if (den == zero) in normalize()
896 den = IntType(1); in normalize()
900 IntType g = integer::gcd(num, den); in normalize()
903 den /= g; in normalize()
905 if (den < -(std::numeric_limits<IntType>::max)()) { in normalize()
910 if (den < zero) { in normalize()
912 den = -den; in normalize()