Changes imported from Abseil "staging" branch:

- 536d004b7e2d48927a5f82e71e9e3a0a9afedbc8 Change uint128 parameters to pass by value. by Alex Strelnikov <strel@google.com>

GitOrigin-RevId: 536d004b7e2d48927a5f82e71e9e3a0a9afedbc8
Change-Id: I9c5e73ce06c8423a27ec7bff2c4accc434e99cb2
This commit is contained in:
Abseil Team 2017-12-05 10:58:48 -08:00 committed by Alex Strelnikov
parent f4f91f4216
commit 1b8dacca62
2 changed files with 44 additions and 44 deletions

View file

@ -124,22 +124,22 @@ uint128::uint128(float v) : uint128(Initialize128FromFloat(v)) {}
uint128::uint128(double v) : uint128(Initialize128FromFloat(v)) {}
uint128::uint128(long double v) : uint128(Initialize128FromFloat(v)) {}
uint128& uint128::operator/=(const uint128& divisor) {
uint128& uint128::operator/=(uint128 other) {
uint128 quotient = 0;
uint128 remainder = 0;
DivModImpl(*this, divisor, &quotient, &remainder);
DivModImpl(*this, other, &quotient, &remainder);
*this = quotient;
return *this;
}
uint128& uint128::operator%=(const uint128& divisor) {
uint128& uint128::operator%=(uint128 other) {
uint128 quotient = 0;
uint128 remainder = 0;
DivModImpl(*this, divisor, &quotient, &remainder);
DivModImpl(*this, other, &quotient, &remainder);
*this = remainder;
return *this;
}
std::ostream& operator<<(std::ostream& o, const uint128& b) {
std::ostream& operator<<(std::ostream& o, uint128 b) {
std::ios_base::fmtflags flags = o.flags();
// Select a divisor which is the largest power of the base < 2^64.