Package lipstone.joshua.parser.types

Examples of lipstone.joshua.parser.types.BigDec.gt()


   
    if (((operation.equals("arcsin") || operation.equals("arccos")) && !(inp.gteq(new BigDec(-1.0)) && inp.lteq(new BigDec(1.0))))
        || ((operation.equals("arcsec") || operation.equals("arccsc")) && (inp.gteq(new BigDec(-1.0)) && inp.lteq(new BigDec(1.0))))
        || (operation.equals("arccosh") && (inp.lt(BigDec.ONE))) || (operation.equals("arctanh") && (inp.abs().gteq(BigDec.ONE)))
        || (operation.equals("arccoth") && (inp.abs().lteq(BigDec.ONE)))
        || (operation.equals("arcsech") && !(inp.gt(BigDec.ZERO) && inp.lteq(BigDec.ONE)))
        || (operation.equals("arccsch") && (inp.eq(BigDec.ZERO)))) {
      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
    }
   
    while ((operation.equals("sec") || operation.equals("csc") || operation.equals("cot")) && inp.lt(BigDec.ZERO))
View Full Code Here


      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
    }
   
    while ((operation.equals("sec") || operation.equals("csc") || operation.equals("cot")) && inp.lt(BigDec.ZERO))
      inp = inp.add(new BigDec(Math.PI * 2));
    while ((operation.equals("sec") || operation.equals("csc") || operation.equals("cot")) && inp.gt(new BigDec(Math.PI * 2)))
      inp = inp.subtract(new BigDec(Math.PI * 2));
   
    if (operation.equals("sin"))
      output = new BigDec(ApcomplexMath.sin(inp.getInternal()));
    if (operation.equals("cos"))
View Full Code Here

      if (order.size() > 1)
        return new ArrayList<BigDec>();
      BigDec o = BigDec.ZERO;
      if (order.size() > 0 && order.get(order.getKeys().get(0)).getCarType() == ConsType.NUMBER)
        o = ((BigDec) order.get(order.getKeys().get(0)).getCar());
      if (o.gt(highestOrder))
        highestOrder = o;
      orders.put(term, o);
    }
   
    BigDec modifier = null;
View Full Code Here

   */
  public ConsCell primeFactor(ConsCell equation) throws ParserException {
    ArrayList<Long> factors = new ArrayList<>();
    BigDec num = (BigDec) parser.run(equation).getCar();
    long[] primes = getPrimes(num.getInternal().longValue());
    for (int i = 0; i < primes.length && num.gt(BigDec.ONE); i++) {
      BigDec prime = new BigDec(primes[i]);
      while (num.mod(prime).eq(BigDec.ZERO)) {
        factors.add(primes[i]);
        num = num.divide(prime);
      }
View Full Code Here

    ConsCell var = new ConsCell(vars.get(0), ConsType.IDENTIFIER);
    for (PairedList<ConsCell, ConsCell> value : orders.getValues()) {
      BigDec order = BigDec.ZERO;
      if (value.containsKey(var))
        order = new BigDec(parser.run(value.get(var)).toString());
      if (highest == null || order.gt(highest))
        highest = order;
    }
    return highest;
  }
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.