/*
(non-Javadoc)

@see
mtas.codec.util.DataCollector.MtasDataOperations#exp2(java.lang.Number)
168462
@Override
  public Double exp2(Double arg1) {
    if (arg1 == null) {
      return Double.NaN;
    } else {
      return Math.exp(arg1);
    }
  }
1018670
public static Object parseExpressWithException(String exp, Object paramObj) {
        Object obj;
        try {
            obj = MVEL.eval(exp, paramObj);
        } catch (Exception e) {
            throw new ParseExpressionException("解析Mvel表达式异常，解析出错的表达式为:" + exp, e);
        }
        return obj;
    }
244992
public static boolean isTrue(String exp, Object paramObj) {
        return Boolean.TRUE.equals(ParseHelper.parseExpressWithException(exp, paramObj));
    }
963626
public void setExpression(Expression exp)
  {
  	if(null != m_mainExp)
    	exp.exprSetParent(m_mainExp.exprGetParent()); // a bit bogus
    m_mainExp = exp;
  }
22295
public MtasDataItemNumberComparator<Double> getCompareValue2() {
    switch (sortType) {
    case CodecUtil.STATS_TYPE_SUMOFLOGS:
      return new MtasDataItemNumberComparator<Double>(valueSumOfLogs,
          sortDirection);
    case CodecUtil.STATS_TYPE_MEAN:
      return new MtasDataItemNumberComparator<Double>(getValue(sortType),
          sortDirection);
    case CodecUtil.STATS_TYPE_GEOMETRICMEAN:
      return new MtasDataItemNumberComparator<Double>(getValue(sortType),
          sortDirection);
    case CodecUtil.STATS_TYPE_STANDARDDEVIATION:
      return new MtasDataItemNumberComparator<Double>(getValue(sortType),
          sortDirection);
    case CodecUtil.STATS_TYPE_VARIANCE:
      return new MtasDataItemNumberComparator<Double>(getValue(sortType),
          sortDirection);
    case CodecUtil.STATS_TYPE_POPULATIONVARIANCE:
      return new MtasDataItemNumberComparator<Double>(getValue(sortType),
          sortDirection);
    case CodecUtil.STATS_TYPE_QUADRATICMEAN:
      return new MtasDataItemNumberComparator<Double>(getValue(sortType),
          sortDirection);
    default:
      return null;
    }
  }
762275
Number numberFor(Number source, Class<?> destinationType) {
    if (destinationType.equals(source.getClass()))
      return source;

    if (destinationType.equals(Byte.class)) {
      long longValue = source.longValue();
      if (longValue > Byte.MAX_VALUE)
        throw new Errors().errorTooLarge(source, destinationType).toMappingException();
      if (longValue < Byte.MIN_VALUE)
        throw new Errors().errorTooSmall(source, destinationType).toMappingException();
      return Byte.valueOf(source.byteValue());
    }

    if (destinationType.equals(Short.class)) {
      long longValue = source.longValue();
      if (longValue > Short.MAX_VALUE)
        throw new Errors().errorTooLarge(source, destinationType).toMappingException();
      if (longValue < Short.MIN_VALUE)
        throw new Errors().errorTooSmall(source, destinationType).toMappingException();
      return Short.valueOf(source.shortValue());
    }

    if (destinationType.equals(Integer.class)) {
      long longValue = source.longValue();
      if (longValue > Integer.MAX_VALUE)
        throw new Errors().errorTooLarge(source, destinationType).toMappingException();
      if (longValue < Integer.MIN_VALUE)
        throw new Errors().errorTooSmall(source, destinationType).toMappingException();
      return Integer.valueOf(source.intValue());
    }

    if (destinationType.equals(Long.class))
      return Long.valueOf(source.longValue());

    if (destinationType.equals(Float.class)) {
      if (source.doubleValue() > Float.MAX_VALUE)
        throw new Errors().errorTooLarge(source, destinationType).toMappingException();
      return Float.valueOf(source.floatValue());
    }

    if (destinationType.equals(Double.class))
      return Double.valueOf(source.doubleValue());

    if (destinationType.equals(BigDecimal.class)) {
      if (source instanceof Float || source instanceof Double)
        return new BigDecimal(source.toString());
      else if (source instanceof BigInteger)
        return new BigDecimal((BigInteger) source);
      else
        return BigDecimal.valueOf(source.longValue());
    }

    if (destinationType.equals(BigInteger.class)) {
      if (source instanceof BigDecimal)
        return ((BigDecimal) source).toBigInteger();
      else
        return BigInteger.valueOf(source.longValue());
    }

    throw new Errors().errorMapping(source, destinationType).toMappingException();
  }
1017060
static ECP2 transformFromProto(Idemix.ECP2 w) {
        byte[] valuexa = w.getXa().toByteArray();
        byte[] valuexb = w.getXb().toByteArray();
        byte[] valueya = w.getYa().toByteArray();
        byte[] valueyb = w.getYb().toByteArray();
        FP2 valuex = new FP2(BIG.fromBytes(valuexa), BIG.fromBytes(valuexb));
        FP2 valuey = new FP2(BIG.fromBytes(valueya), BIG.fromBytes(valueyb));
        return new ECP2(valuex, valuey);
    }
210230
function validateNumber(node, schema, key) {
    if (isNaN(parseFloat(node)) || !isFinite(node)) {
      throw new ValidationException("Expected number for " + key);
    }
    if (schema[SCHEMAREGEX]) {
      checkRegex(node, schema, key);
    }
  }
465564
public void setExpan(String v) {
    if (Abbreviation_Type.featOkTst && ((Abbreviation_Type)jcasType).casFeat_expan == null)
      jcasType.jcas.throwFeatMissing("expan", "de.julielab.jules.types.Abbreviation");
    jcasType.ll_cas.ll_setStringValue(addr, ((Abbreviation_Type)jcasType).casFeatCode_expan, v);}
21827
@Override
    public <T extends Number> T numberValueExact(Class<T> numberType) {
        return ConvertNumberValue.ofExact(numberType, number);
    }
745786
protected AForAllExp makeRelContext(ATypeDefinition node, AVariableExp... exps){

		AForAllExp forall_exp = new AForAllExp();
		forall_exp.setType(new ABooleanBasicType());

		ATypeMultipleBind tmb = new ATypeMultipleBind();
		List<PPattern> pats = new LinkedList<>();
		for (AVariableExp exp : exps)
		{
			pats.add(AstFactory.newAIdentifierPattern(exp.getName().clone()));
		}
		tmb.setPlist(pats);
		tmb.setType(node.getType().clone());
		List<PMultipleBind> binds = new LinkedList<>();
		binds.add(tmb);
		forall_exp.setBindList(binds);
		return forall_exp;
	}
623367
private Object executeExp(PageContext pc, SQL sql, Query qr, Expression exp, int row) throws PageException {
	// print.e("name:"+exp.getClass().getName());
	if (exp instanceof Value) return ((Value) exp).getValue();// executeConstant(sql,qr, (Value)exp, row);
	if (exp instanceof Column) return executeColumn(sql, qr, (Column) exp, row);
	if (exp instanceof Operation) return executeOperation(pc, sql, qr, (Operation) exp, row);
	if (exp instanceof BracketExpression) return executeBracked(pc, sql, qr, (BracketExpression) exp, row);
	throw new DatabaseException("unsupported sql statement [" + exp + "]", null, sql, null);
    }
1174720
public static <A extends Number & Comparable<?>> NumberExpression<Double> exp(Expression<A> num) {
        return Expressions.numberOperation(Double.class, Ops.MathOps.EXP, num);
    }
1255394
def exp2prob(expression_vector):
    
    v = np.asarray(expression_vector)
    if np.sum(v) == 0:
        return np.zeros(len(expression_vector))
    else:
        return v / np.sum(v)
528938
public static BigFloat exp(BigFloat x) {
		if(x.isSpecial())
			return x != NEGATIVE_INFINITY ? x : x.context.ZERO;
		return x.context.valueOf(BigDecimalMath.exp(x.value, x.context.mathContext));
	}
970888
public static void main2(String args[]) {
        String dbDriver = "COM.ibm.db2.jdbc.app.DB2Driver";
        String url = "jdbc:db2:sample";
        String user = "batra";
        String pass = "varunbatra";
        String querystring = "Select * from batra.employee";
        String fn;
        String ln;
        String bd;
        String sal;

        try {
            ConnectionProperties cp = new ConnectionProperties(dbDriver, url, user, pass);
            Query query = new Query(cp, querystring);
            QueryResults qs = query.execute();
            System.out.println("Number of rows = " + qs.size());
            while (qs.next()) {
                fn = qs.getValue("FIRSTNME");
                ln = qs.getValue("LASTNAME");
                bd = qs.getValue("BIRTHDATE");
                sal = qs.getValue("SALARY");
                System.out.println(fn + " " + ln + " birthdate " + bd + " salary " + sal);
            }
        }
        catch (Exception e) {
            //com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.webcontainer.jsp.tsx.db.Query.main2", "348");
            System.out.println("Exception: " + e.getMessage());
        }
        System.out.println("All is Fine!");
    }
13215
public static void int2(byte[] target, int idx, int value) {
    target[idx + 0] = (byte) (value >>> 8);
    target[idx + 1] = (byte) value;
  }