File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -750,12 +750,12 @@ function GenerateArithmeticOperators([GeneratorArgs]$genArgs)
750750
751751 public static $quantityName operator +($quantityName left, $quantityName right)
752752 {
753- return new $quantityName (left.Value + right.AsBaseNumericType(left.Unit ), left.Unit);
753+ return From (left.AsBaseUnit() + right.AsBaseUnit( ), BaseUnit).ToUnit( left.Unit);
754754 }
755755
756756 public static $quantityName operator -($quantityName left, $quantityName right)
757757 {
758- return new $quantityName (left.Value - right.AsBaseNumericType(left.Unit ), left.Unit);
758+ return From (left.AsBaseUnit() - right.AsBaseUnit( ), BaseUnit).ToUnit( left.Unit);
759759 }
760760
761761 public static $quantityName operator *($valueType left, $quantityName right)
@@ -812,12 +812,12 @@ function GenerateEqualityAndComparison([GeneratorArgs]$genArgs)
812812 return left.Value > right.AsBaseNumericType(left.Unit);
813813 }
814814
815- public static bool operator ==($quantityName left, $quantityName right)
815+ public static bool operator ==($quantityName left, $quantityName right)
816816 {
817817 return left.Equals(right);
818818 }
819819
820- public static bool operator !=($quantityName left, $quantityName right)
820+ public static bool operator !=($quantityName left, $quantityName right)
821821 {
822822 return !(left == right);
823823 }
You can’t perform that action at this time.
0 commit comments