From: Jan Kotas Date: Tue, 16 Jan 2018 23:26:16 +0000 (-0800) Subject: Matching non-shared Decimal changes X-Git-Tag: accepted/tizen/base/20180629.140029~129 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a433a9ca4b4d7f37987db11a7e842e64517edf27;p=platform%2Fupstream%2Fcoreclr.git Matching non-shared Decimal changes --- diff --git a/src/mscorlib/src/System/Decimal.cs b/src/mscorlib/src/System/Decimal.cs index 67c2c87..b66519c 100644 --- a/src/mscorlib/src/System/Decimal.cs +++ b/src/mscorlib/src/System/Decimal.cs @@ -353,7 +353,7 @@ namespace System // positive, the result is d. If d is negative, the result // is -d. // - internal static Decimal Abs(Decimal d) + internal static Decimal Abs(ref Decimal d) { return new Decimal(d.lo, d.mid, d.hi, d.flags & ~SignMask); } @@ -714,14 +714,14 @@ namespace System // Returns the larger of two Decimal values. // - internal static Decimal Max(Decimal d1, Decimal d2) + internal static Decimal Max(ref Decimal d1, ref Decimal d2) { return FCallCompare(ref d1, ref d2) >= 0 ? d1 : d2; } // Returns the smaller of two Decimal values. // - internal static Decimal Min(Decimal d1, Decimal d2) + internal static Decimal Min(ref Decimal d1, ref Decimal d2) { return FCallCompare(ref d1, ref d2) < 0 ? d1 : d2; } @@ -737,7 +737,7 @@ namespace System // This piece of code is to work around the fact that Dividing a decimal with 28 digits number by decimal which causes // causes the result to be 28 digits, can cause to be incorrectly rounded up. // eg. Decimal.MaxValue / 2 * Decimal.MaxValue will overflow since the division by 2 was rounded instead of being truncked. - if (Abs(d1) < Abs(d2)) + if (Math.Abs(d1) < Math.Abs(d2)) { return d1; }