Lines Matching refs:rhs
36 BigInteger(const BigInteger& rhs) : count_(rhs.count_) { in BigInteger() argument
37 std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type)); in BigInteger()
60 BigInteger& operator=(const BigInteger &rhs)
62 if (this != &rhs) {
63 count_ = rhs.count_;
64 std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type));
159 bool operator==(const BigInteger& rhs) const {
160 … return count_ == rhs.count_ && std::memcmp(digits_, rhs.digits_, count_ * sizeof(Type)) == 0;
163 bool operator==(const Type rhs) const {
164 return count_ == 1 && digits_[0] == rhs;
191 bool Difference(const BigInteger& rhs, BigInteger* out) const { in Difference() argument
192 int cmp = Compare(rhs); in Difference()
196 if (cmp < 0) { a = &rhs; b = this; ret = true; } in Difference()
197 else { a = this; b = &rhs; ret = false; } in Difference()
213 int Compare(const BigInteger& rhs) const { in Compare() argument
214 if (count_ != rhs.count_) in Compare()
215 return count_ < rhs.count_ ? -1 : 1; in Compare()
218 if (digits_[i] != rhs.digits_[i]) in Compare()
219 return digits_[i] < rhs.digits_[i] ? -1 : 1; in Compare()