Skip to content

Commit

Permalink
Update src/libraries/System.Private.CoreLib/src/System/UInt128.cs
Browse files Browse the repository at this point in the history
Co-authored-by: Günther Foidl <[email protected]>
  • Loading branch information
Daniel-Svensson and gfoidl authored Mar 14, 2024
1 parent a032637 commit 6170e5e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libraries/System.Private.CoreLib/src/System/UInt128.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,9 @@ public static UInt128 Log2(UInt128 value)

// We might need 2 division to avoid overflow
if (remainder >= right._lower)
{
(highRes, remainder) = X86Base.X64.DivRem(remainder, 0, right._lower);
}

return new UInt128(highRes, X86Base.X64.DivRem(left._lower, remainder, right._lower).Quotient);
}
Expand Down

0 comments on commit 6170e5e

Please sign in to comment.