Arithmetic evaluation: Difference between revisions

Line 1,184:
Uses the [[Arithmetic/Rational/Java|BigRational class]] to handle arbitrary-precision numbers (rational numbers since basic arithmetic will result in rational values).
 
<lang java>import java.util.LinkedListStack;
 
public class ArithmeticEvaluation
Line 1,241:
}
public static void createNewOperand(BinaryOperator operator, LinkedListStack<Object> operands)
{
Object rightOperand = operands.pop();
Line 1,252:
int curIndex = 0;
boolean afterOperand = false;
LinkedListStack<Object> operands = new LinkedListStack<Object>();
LinkedListStack<Object> operators = new LinkedListStack<Object>();
inputStringLoop:
while (curIndex < inputString.length())
Anonymous user