//**************************************************************************************************** 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("Неправильные операнды."); }
//**************************************************************************************************** public override bool MoreThan(SingleVar b) { if (!b.IsNum()) throw new CalcException("Ќеверные типы операндов"); return this.ToDouble() > ((NumVar) b).ToDouble(); }