示例#1
0
        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));
        }
示例#2
0
 public static Exponential operator +(Exponential a, Exponential b)
 {
     return(Exponential.Add(a, b));
 }