Package lipstone.joshua.parser.types

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


      if (operation.equals(str)) {
        inp = parser.getAngleType().toRadians(inp);
        break;
      }
   
    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)))) {
View Full Code Here


        inp = parser.getAngleType().toRadians(inp);
        break;
      }
   
    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);
View Full Code Here

    BigDec output = BigDec.ONE;
    ConsCell num = parser.run(parts.get(0));
    if (num.getCarType() != ConsType.NUMBER || !((BigDec) num.getCar()).isInt() || !((BigDec) num.getCar()).gteq(BigDec.ZERO))
      throw new ParserException("The factorial operation is only defined for arguments that evaluate to whole numbers", this);
    BigDec cap = (BigDec) num.getCar();
    if (cap.gteq(numFactorial))
      for (BigDec i = new BigDec(cap); i.gteq(BigDec.ONE); i = i.subtract(numFactorial))
        output = output.multiply(i);
    return output;
  }
 
View Full Code Here

    ConsCell num = parser.run(parts.get(0));
    if (num.getCarType() != ConsType.NUMBER || !((BigDec) num.getCar()).isInt() || !((BigDec) num.getCar()).gteq(BigDec.ZERO))
      throw new ParserException("The factorial operation is only defined for arguments that evaluate to whole numbers", this);
    BigDec cap = (BigDec) num.getCar();
    if (cap.gteq(numFactorial))
      for (BigDec i = new BigDec(cap); i.gteq(BigDec.ONE); i = i.subtract(numFactorial))
        output = output.multiply(i);
    return output;
  }
 
  /**
 
View Full Code Here

 
  private boolean isAnswer(BigDec point, BigDec accuracy) throws ParserException {
    try { //Try-Catch here because an UndefinedResultException means false, not error.
      BigDec ans = getY(point);
      //The slightly awkward comparison set is used here because it is faster than creating a new object for the absolute value method
      return ans.lteq(answer.add(accuracy)) && ans.gteq(answer.subtract(accuracy));
    }
    catch (UndefinedResultException e) {
      return false;
    }
  }
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.