lib/integral.js
function getNumericValue(expr) {
    var simplified = simplifyConstant(expr);
    return toNumber(simplified);

    function toNumber(expr) {
      if(expr.type === 'OperatorNode' && expr.op === '-' && expr.args.length === 1) {
        // Unary minus
        var num = toNumber(expr.args[0]);
        return num === undefined ? undefined : -num;
      } else if(expr.type === 'ConstantNode' && (!expr.valueType || expr.valueType === 'number')) {
        return +expr.value;
      } else {
        return undefined;
      }
    }
  }
function getNumericValue(expr) {
    var simplified = simplifyConstant(expr);
    return toNumber(simplified);

    function toNumber(expr) {
      if(expr.type === 'OperatorNode' && expr.op === '-' && expr.args.length === 1) {
        // Unary minus
        var num = toNumber(expr.args[0]);
        return num === undefined ? undefined : -num;
      } else if(expr.type === 'ConstantNode' && (!expr.valueType || expr.valueType === 'number')) {
        return +expr.value;
      } else {
        return undefined;
      }
    }
  }
Gets the numerical value of the given node if possible, othewise returns undefined.
TODO: does this work with BigNumber / Fractions / etc.