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:
parent
f4f91f4216
commit
1b8dacca62
2 changed files with 44 additions and 44 deletions
|
@ -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, "ient, &remainder);
|
||||
DivModImpl(*this, other, "ient, &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, "ient, &remainder);
|
||||
DivModImpl(*this, other, "ient, &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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue