Example #1
0
 public CalcResult <T> Add(T a)
 {
     if (IsValid)
     {
         try
         {
             _value = Arithmetic <T> .Add(_value, a);
         }
         catch (Exception e)
         {
             Message = e.Message;
             IsValid = false;
         }
     }
     return(this);
 }
Example #2
0
 public CalcResult <T> Add(CalcResult <T> cr)
 {
     if (IsValid)
     {
         if (cr.IsValid)
         {
             try
             {
                 _value = Arithmetic <T> .Add(_value, cr._value);
             }
             catch (Exception e)
             {
                 Message = e.Message;
                 IsValid = false;
             }
         }
         else
         {
             return(cr);
         }
     }
     return(this);
 }
Example #3
0
 public static T Add <T>(T x, T y) => Arithmetic <T> .Add(x, y);