Package org.formulacompiler.runtime

Examples of org.formulacompiler.runtime.FormulaException


          return new_x;
        }
      }
      x = new_x;
    }
    throw new FormulaException( "#NUM! because result not found in " + MAX_ITER + " tries in IRR" );
  }
View Full Code Here


    final String text = _text.trim();
    final Number number = parseNumber( text, false, _environment, _mode == ComputationMode.EXCEL );
    if (number != null) {
      return number.doubleValue();
    }
    throw new FormulaException( "#VALUE! because of argument of unsupported type in VALUE" );
  }
View Full Code Here

    try {
      final double date = parseDateAndOrTime( text, _environment, _mode == ComputationMode.EXCEL );
      return Math.floor( date );
    }
    catch (ParseException e) {
      throw new FormulaException( "#VALUE! because argument could not be interpreted properly in DATEVALUE" );
    }
  }
View Full Code Here

    try {
      double dataTime = parseDateAndOrTime( text, _environment, _mode == ComputationMode.EXCEL );
      return dataTime - Math.floor( dataTime );
    }
    catch (ParseException e) {
      throw new FormulaException( "#VALUE! because argument could not be interpreted properly in TIMEVALUE" );
    }
  }
View Full Code Here

    final long EPSILON = _cx.fromDouble( 0.1E-320 );
    long factor = fun_POWER( q, fun_INT( _n, _cx ), _cx );
    if (factor <= EPSILON) {
      factor = fun_POWER( _p, n, _cx );
      if (factor <= EPSILON) {
        throw new FormulaException( "#NUM! because factor = 0 in CRITBINOM" );
      }
      else {
        long sum = _cx.one - factor;
        long i;
        for (i = 0; i < n && sum >= _alpha; i = i + _cx.one) {
View Full Code Here

      else {
        return _cx.fromDouble( number.doubleValue() );
      }
    }
    else {
      throw new FormulaException( "#VALUE! because of argument of unsupported type in VALUE" );
    }
  }
View Full Code Here

    }
    BigDecimal q = ONE.subtract( _p );
    final BigDecimal EPSILON = BigDecimal.valueOf( 0.1E-320 );
    int n = _n.intValue();
    if (n > 999999999) {
      throw new FormulaException( "#NUM! because n value is too large in CRITBINOM" );
    }
    BigDecimal factor = q.pow( n );
    if (factor.compareTo( EPSILON ) <= 0) {
      factor = _p.pow( n );
      if (factor.compareTo( EPSILON ) <= 0) {
        throw new FormulaException( "#NUM! because factor = 0 in CRITBINOM" );
      }
      else {
        BigDecimal sum = ONE.subtract( factor );
        int i;
        for (i = 0; i < n && sum.compareTo( _alpha ) >= 0; i++) {
View Full Code Here

        }
      }
      x = new_x;

    }
    throw new FormulaException( "#NUM! because result not found in " + EXCEL_MAX_ITER + " tries in IRR" );
  }
View Full Code Here

      else {
        return valueOf( number.doubleValue() );
      }
    }
    else {
      throw new FormulaException( "#VALUE! because of argument of unsupported type in VALUE" );
    }
  }
View Full Code Here

TOP

Related Classes of org.formulacompiler.runtime.FormulaException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.