Пример #1
0
 public static EvaluationResult Decrement(EvaluationResult number)
 {
     if (number == null)
     {
         throw new ArgumentNullException(nameof(number));
     }
     if (number.Type == EvaluationType.Int)
     {
         return(number.AsInt().Value - 1);
     }
     if (number.Type == EvaluationType.Float)
     {
         return(number.AsFloat().Value - 1f);
     }
     throw new Exception("Decrement expects a number");
 }