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); }
public override int GetHashCode() { return(UnitBaseQuantities.Aggregate(0, (i, q) => ((i * 397) ^ (q.GetHashCode() * ((int)GetPower(q)))))); }