@@ -353,7 +353,7 @@ private Decimal(int lo, int mid, int hi, int flags)
353353 // positive, the result is d. If d is negative, the result
354354 // is -d.
355355 //
356- internal static Decimal Abs ( Decimal d )
356+ internal static Decimal Abs ( ref Decimal d )
357357 {
358358 return new Decimal ( d . lo , d . mid , d . hi , d . flags & ~ SignMask ) ;
359359 }
@@ -714,14 +714,14 @@ private static void InternalRoundFromZero(ref Decimal d, int decimalCount)
714714
715715 // Returns the larger of two Decimal values.
716716 //
717- internal static Decimal Max ( Decimal d1 , Decimal d2 )
717+ internal static Decimal Max ( ref Decimal d1 , ref Decimal d2 )
718718 {
719719 return FCallCompare ( ref d1 , ref d2 ) >= 0 ? d1 : d2 ;
720720 }
721721
722722 // Returns the smaller of two Decimal values.
723723 //
724- internal static Decimal Min ( Decimal d1 , Decimal d2 )
724+ internal static Decimal Min ( ref Decimal d1 , ref Decimal d2 )
725725 {
726726 return FCallCompare ( ref d1 , ref d2 ) < 0 ? d1 : d2 ;
727727 }
@@ -737,7 +737,7 @@ public static Decimal Remainder(Decimal d1, Decimal d2)
737737 // This piece of code is to work around the fact that Dividing a decimal with 28 digits number by decimal which causes
738738 // causes the result to be 28 digits, can cause to be incorrectly rounded up.
739739 // eg. Decimal.MaxValue / 2 * Decimal.MaxValue will overflow since the division by 2 was rounded instead of being truncked.
740- if ( Abs ( d1 ) < Abs ( d2 ) )
740+ if ( Math . Abs ( d1 ) < Math . Abs ( d2 ) )
741741 {
742742 return d1 ;
743743 }
0 commit comments