Matching non-shared Decimal changes
authorJan Kotas <jkotas@microsoft.com>
Tue, 16 Jan 2018 23:26:16 +0000 (15:26 -0800)
committerJan Kotas <jkotas@microsoft.com>
Wed, 17 Jan 2018 02:39:02 +0000 (18:39 -0800)
src/mscorlib/src/System/Decimal.cs

index 67c2c87..b66519c 100644 (file)
@@ -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;
             }