public static Quantity Add(Quantity a, Quantity b) { if (!Quantity.SameDimension(a, b)) { throw new ArgumentException("Quantities of a different dimension cannot be added "); } a = a.UnPrefixed(); b = b.UnPrefixed(); Exponential value = Exponential.Add(a.Value, b.Value); return(new Quantity(value, a.Metric)); }
public static Exponential operator +(Exponential a, Exponential b) { return(Exponential.Add(a, b)); }