@@ -420,7 +420,7 @@ public static explicit operator decimal(Fixed64 value)
420420 if ( ! negative )
421421 {
422422 if ( roundedOverflow || magnitude > long . MaxValue )
423- return MAX_VALUE ;
423+ return new Fixed64 ( FixedMath . MAX_VALUE_L ) ;
424424
425425 return new Fixed64 ( ( long ) magnitude ) ;
426426 }
@@ -430,10 +430,10 @@ public static explicit operator decimal(Fixed64 value)
430430 const ulong minValueMagnitude = 0x8000000000000000UL ;
431431
432432 if ( roundedOverflow || magnitude > minValueMagnitude )
433- return MIN_VALUE ;
433+ return new Fixed64 ( FixedMath . MIN_VALUE_L ) ;
434434
435435 if ( magnitude == minValueMagnitude )
436- return MIN_VALUE ;
436+ return new Fixed64 ( FixedMath . MIN_VALUE_L ) ;
437437
438438 return new Fixed64 ( - ( long ) magnitude ) ;
439439 }
@@ -577,7 +577,9 @@ private static ulong ShiftRightRoundedToEven(ulong hi, ulong lo, int shift, out
577577
578578 // Detect overflow
579579 if ( ( div & ~ ( 0xFFFFFFFFFFFFFFFF >> bitPos ) ) != 0 )
580- return ( ( xl ^ yl ) & FixedMath . MIN_VALUE_L ) == 0 ? MAX_VALUE : MIN_VALUE ;
580+ return ( ( xl ^ yl ) & FixedMath . MIN_VALUE_L ) == 0
581+ ? new Fixed64 ( FixedMath . MAX_VALUE_L )
582+ : new Fixed64 ( FixedMath . MIN_VALUE_L ) ;
581583
582584 remainder <<= 1 ;
583585 -- bitPos ;
@@ -629,7 +631,9 @@ private static ulong ShiftRightRoundedToEven(ulong hi, ulong lo, int shift, out
629631 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
630632 public static Fixed64 operator - ( Fixed64 x )
631633 {
632- return x . m_rawValue == FixedMath . MIN_VALUE_L ? MAX_VALUE : new Fixed64 ( - x . m_rawValue ) ;
634+ return x . m_rawValue == FixedMath . MIN_VALUE_L
635+ ? new Fixed64 ( FixedMath . MAX_VALUE_L )
636+ : new Fixed64 ( - x . m_rawValue ) ;
633637 }
634638
635639 /// <summary>
0 commit comments