Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update src/libraries/System.Private.CoreLib/src/System/Int128.cs
  • Loading branch information
stephentoub authored Jan 3, 2024
commit 3cf5d888f6d24f14442792c7c18bef1740485d10
4 changes: 2 additions & 2 deletions src/libraries/System.Private.CoreLib/src/System/Int128.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1904,8 +1904,8 @@ static bool INumberBase<Int128>.TryConvertToSaturating<TOther>(Int128 value, [Ma
}
else if (typeof(TOther) == typeof(ulong))
{
ulong actualResult = (value <= 0) ? ulong.MinValue :
(value >= ulong.MaxValue) ? ulong.MaxValue : (ulong)value;
ulong actualResult = (value >= ulong.MaxValue) ? ulong.MaxValue :
(value <= ulong.MinValue) ? ulong.MinValue : (ulong)value;
result = (TOther)(object)actualResult;
return true;
}
Expand Down