Changes imported from Abseil "staging" branch:
- b7ac57541b07fadc3ed054cc3d62bc192a2098a7 Redefine arithmetic assign operators in terms of the bina... by Alex Strelnikov <strel@google.com> - bb2bf3fd86eb9f24420376aad1b9fe84068ad7e4 Cmake CI for Ubuntu by Jon Cohen <cohenjon@google.com> - 3ff3e6d6b4d99627f0785cad5b562362bdf1ae37 Fix internal namespace (debug_internal -> debugging_inter... by Derek Mauro <dmauro@google.com> - b50753d757c95a3430cc2d6cfc0272af1e5c219c Internal change. by Alex Strelnikov <strel@google.com> GitOrigin-RevId: b7ac57541b07fadc3ed054cc3d62bc192a2098a7 Change-Id: I7561639e296d1cc5dc7ee75e6645e8dae3f1bf97
This commit is contained in:
parent
bf7fc9986e
commit
3917120a4c
12 changed files with 116 additions and 86 deletions
|
@ -20,6 +20,7 @@
|
|||
#include <iostream> // NOLINT(readability/streams)
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
namespace absl {
|
||||
|
||||
|
@ -128,19 +129,17 @@ uint128::uint128(float v) : uint128(MakeUint128FromFloat(v)) {}
|
|||
uint128::uint128(double v) : uint128(MakeUint128FromFloat(v)) {}
|
||||
uint128::uint128(long double v) : uint128(MakeUint128FromFloat(v)) {}
|
||||
|
||||
uint128& uint128::operator/=(uint128 other) {
|
||||
uint128 operator/(uint128 lhs, uint128 rhs) {
|
||||
uint128 quotient = 0;
|
||||
uint128 remainder = 0;
|
||||
DivModImpl(*this, other, "ient, &remainder);
|
||||
*this = quotient;
|
||||
return *this;
|
||||
DivModImpl(lhs, rhs, "ient, &remainder);
|
||||
return quotient;
|
||||
}
|
||||
uint128& uint128::operator%=(uint128 other) {
|
||||
uint128 operator%(uint128 lhs, uint128 rhs) {
|
||||
uint128 quotient = 0;
|
||||
uint128 remainder = 0;
|
||||
DivModImpl(*this, other, "ient, &remainder);
|
||||
*this = remainder;
|
||||
return *this;
|
||||
DivModImpl(lhs, rhs, "ient, &remainder);
|
||||
return remainder;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue