Beispiel #1
0
        //****************************************************************************************************
		public override SingleVar add(SingleVar b) {
			if (b.IsNum()) {
				try {
					return new RealVar(this.m_val + ((NumVar) b).ToDouble());
				}
				catch (Exception) {
					throw new CalcException("Ошибка в вычислениях.");
				}
			}
			else
				throw new CalcException("Неправильные операнды.");
		}
Beispiel #2
0
        //****************************************************************************************************
		public override bool MoreThan(SingleVar b) {
			if (!b.IsNum())
				throw new CalcException("Ќеверные типы операндов");
			return this.ToDouble() > ((NumVar) b).ToDouble();
		}