コード例 #1
0
ファイル: Unit.cs プロジェクト: hultqvist/lax
 public static Unit operator /(Unit a, Unit b)
 {
     var c = new Unit();
     foreach (var e in a.Exponent)
         c.AddExponent(e.Key, e.Value); //Above the division
     foreach (var e in b.Exponent)
         c.AddExponent(e.Key, -e.Value);//Below the division
     return c;
 }
コード例 #2
0
ファイル: Unit.cs プロジェクト: hultqvist/lax
 public static Unit operator *(Unit a, Unit b)
 {
     var c = new Unit();
     foreach (var e in a.Exponent)
         c.AddExponent(e.Key, e.Value);
     foreach (var e in b.Exponent)
         c.AddExponent(e.Key, e.Value);
     return c;
 }