spreadsheet/ruleJS.all.full.js
function (type, number1, number2) {
      var result;

      number1 = helper.number(number1);
      number2 = helper.number(number2);

      if (isNaN(number1) || isNaN(number2)) {

        if (number1[0] === '=' || number2[0] === '=') {
          throw Error('NEED_UPDATE');
        }

        throw Error('VALUE');
      }

      switch (type) {
        case '+':
          result = number1 + number2;
          break;
        case '-':
          result = number1 - number2;
          break;
        case '/':
          result = number1 / number2;
          if (result == Infinity) {
            throw Error('DIV_ZERO');
          } else if (isNaN(result)) {
            throw Error('VALUE');
          }
          break;
        case '*':
          result = number1 * number2;
          break;
        case '^':
          result = Math.pow(number1, number2);
          break;
      }

      return result;
    }
function (type, number1, number2) {
      var result;

      number1 = helper.number(number1);
      number2 = helper.number(number2);

      if (isNaN(number1) || isNaN(number2)) {

        if (number1[0] === '=' || number2[0] === '=') {
          throw Error('NEED_UPDATE');
        }

        throw Error('VALUE');
      }

      switch (type) {
        case '+':
          result = number1 + number2;
          break;
        case '-':
          result = number1 - number2;
          break;
        case '/':
          result = number1 / number2;
          if (result == Infinity) {
            throw Error('DIV_ZERO');
          } else if (isNaN(result)) {
            throw Error('VALUE');
          }
          break;
        case '*':
          result = number1 * number2;
          break;
        case '^':
          result = Math.pow(number1, number2);
          break;
      }

      return result;
    }
function ( type , number1 , number2 ) { var result ; number1 = helper . number ( number1 ) ; number2 = helper . number ( number2 ) ; if ( isNaN ( number1 ) || isNaN ( number2 ) ) { if ( number1 [ 0 ] === '=' || number2 [ 0 ] === '=' ) { throw Error ( 'NEED_UPDATE' ) ; } throw Error ( 'VALUE' ) ; } switch ( type ) { case '+' : result = number1 + number2 ; break ; case '-' : result = number1 - number2 ; break ; case '/' : result = number1 / number2 ; if ( result == Infinity ) { throw Error ( 'DIV_ZERO' ) ; } else if ( isNaN ( result ) ) { throw Error ( 'VALUE' ) ; } break ; case '*' : result = number1 * number2 ; break ; case '^' : result = Math . pow ( number1 , number2 ) ; break ; } return result ; }
match math operation
@param {String} type
@param {Number} number1
@param {Number} number2
@returns {*}
match math operation