Example #1
0
 public override bool Equals(object obj)
 {
     if (obj is UnitDimension)
     {
         var other = obj as UnitDimension;
         return(UnitBaseQuantities.All(q => GetPower(q) == other.GetPower(q)));
     }
     return(false);
 }
Example #2
0
 public override int GetHashCode()
 {
     return(UnitBaseQuantities.Aggregate(0, (i, q) => ((i * 397) ^ (q.GetHashCode() * ((int)GetPower(q))))));
 }