}
private float doEvaluateCalculation(String calculation) throws ParseException {
try {
Expression exp = new Expression(calculation, env);
Object result = exp.evaluate();
if (result instanceof Double) {
return ((Double) result).floatValue();
} else if (result instanceof Integer) {
return ((Integer) result).floatValue();
} else throw new ArgumentParseException("Parse exception: expected Double or Integer, but got:"