Lines Matching defs:rhs
32 BigInteger(const BigInteger& rhs) : count_(rhs.count_) {
33 std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type));
55 BigInteger& operator=(const BigInteger &rhs)
57 if (this != &rhs) {
58 count_ = rhs.count_;
59 std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type));
154 bool operator==(const BigInteger& rhs) const {
155 return count_ == rhs.count_ && std::memcmp(digits_, rhs.digits_, count_ * sizeof(Type)) == 0;
158 bool operator==(const Type rhs) const {
159 return count_ == 1 && digits_[0] == rhs;
184 // Compute absolute difference of this and rhs.
185 // Assume this != rhs
186 bool Difference(const BigInteger& rhs, BigInteger* out) const {
187 int cmp = Compare(rhs);
191 if (cmp < 0) { a = &rhs; b = this; ret = true; }
192 else { a = this; b = &rhs; ret = false; }
208 int Compare(const BigInteger& rhs) const {
209 if (count_ != rhs.count_)
210 return count_ < rhs.count_ ? -1 : 1;
213 if (digits_[i] != rhs.digits_[i])
214 return digits_[i] < rhs.digits_[i] ? -1 : 1;