js/calc.js
/**
 * Replaces ~ by - and removes outer brackets. Eg: "(5 * ~3)", to "5 * -3".
 * @param exp String represating the expression that needs to be repaired
 * @return String repaired expression.
 * */
Replaces ~ by - and removes outer brackets.
Replaces ~ by - and removes outer brackets .
function repairExpression(exp)
{
	exp = exp.replace(/~/g, "-");
	exp = exp.replace("(", "");
	exp = exp.substr(0, exp.lastIndexOf(")"));
	return exp;
}
function repairExpression ( exp ) { exp = exp . replace ( / ~ / g , "-" ) ; exp = exp . replace ( "(" , "" ) ; exp = exp . substr ( 0 , exp . lastIndexOf ( ")" ) ) ; return exp ; }
Replaces ~ by - and removes outer brackets.
Replaces ~ by - and removes outer brackets .