/// <summary> /// Pushes the given value into the stack /// </summary> /// <param name="number">value to push into stack</param> public void Push(int number) { XInt xNumber = new XInt(); xNumber.SetNumber(number); Stack.Push(xNumber); }
/// <summary> /// Subdivides two top most values /// </summary> /// <returns>subdivision result</returns> public int Sub() { XInt xNumber_1 = Stack.Pop(); XInt xNumber_2 = Stack.Pop(); XInt xNumber_result = new XInt(); xNumber_result.SetNumber(xNumber_1.ConvertToInt() - xNumber_2.ConvertToInt()); Stack.Push(xNumber_result); return(xNumber_result.ConvertToInt()); }