We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc9b4e1 commit ba91a0aCopy full SHA for ba91a0a
libutil/src/MulHi64.cpp
@@ -52,7 +52,10 @@ auto mul_hi64(
52
{
53
__extension__ using uint128_t = unsigned __int128;
54
55
- return (static_cast<uint128_t>(first) * static_cast<uint128_t>(second)) >> UINT64_C(64);
+ const uint128_t prod = static_cast<uint128_t>(first) * static_cast<uint128_t>(second);
56
+
57
+ return static_cast<uint64_t>(
58
+ prod >> static_cast<uint128_t>(64));
59
}
60
61
} // namespace util::math
0 commit comments