Package lipstone.joshua.parser.types

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


    if (value.length() != 1 || value.getCarType() != ConsType.NUMBER)
      throw new UndefinedResultException("The " + operation + " operation takes one decimal number for its arguments.", this);
    BigDec inp = (BigDec) value.getCar();
   
    //Special points (e.g. angles at which sin, cos, etc. have exact answers
    if (operation.equals("cos") && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(90.0)))
        || (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(new BigDec(Math.PI / 2))) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(new BigDec(100.0))))) {
      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
    }
    if ((operation.equals("sin") || operation.equals("tan")) && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(0.0)))
        || (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(BigDec.ZERO)) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(BigDec.ZERO)))) {
View Full Code Here


      throw new UndefinedResultException("The " + operation + " operation takes one decimal number for its arguments.", this);
    BigDec inp = (BigDec) value.getCar();
   
    //Special points (e.g. angles at which sin, cos, etc. have exact answers
    if (operation.equals("cos") && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(90.0)))
        || (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(new BigDec(Math.PI / 2))) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(new BigDec(100.0))))) {
      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
    }
    if ((operation.equals("sin") || operation.equals("tan")) && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(0.0)))
        || (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(BigDec.ZERO)) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(BigDec.ZERO)))) {
      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
View Full Code Here

      throw new UndefinedResultException("The " + operation + " operation takes one decimal number for its arguments.", this);
    BigDec inp = (BigDec) value.getCar();
   
    //Special points (e.g. angles at which sin, cos, etc. have exact answers
    if (operation.equals("cos") && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(90.0)))
        || (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(new BigDec(Math.PI / 2))) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(new BigDec(100.0))))) {
      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
    }
    if ((operation.equals("sin") || operation.equals("tan")) && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(0.0)))
        || (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(BigDec.ZERO)) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(BigDec.ZERO)))) {
      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
View Full Code Here

    //Special points (e.g. angles at which sin, cos, etc. have exact answers
    if (operation.equals("cos") && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(90.0)))
        || (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(new BigDec(Math.PI / 2))) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(new BigDec(100.0))))) {
      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
    }
    if ((operation.equals("sin") || operation.equals("tan")) && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(0.0)))
        || (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(BigDec.ZERO)) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(BigDec.ZERO)))) {
      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
    }
    if (operation.equals("sin") && (parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(360.0)).eq(new BigDec(30.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(Math.PI / 6)) || parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(33.333333)))) {
View Full Code Here

    if (operation.equals("cos") && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(90.0)))
        || (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(new BigDec(Math.PI / 2))) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(new BigDec(100.0))))) {
      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
    }
    if ((operation.equals("sin") || operation.equals("tan")) && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(0.0)))
        || (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(BigDec.ZERO)) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(BigDec.ZERO)))) {
      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
    }
    if (operation.equals("sin") && (parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(360.0)).eq(new BigDec(30.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(Math.PI / 6)) || parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(33.333333)))) {
      return new ConsCell(new BigDec(0.5), ConsType.NUMBER);
View Full Code Here

    if (operation.equals("cos") && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(90.0)))
        || (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(new BigDec(Math.PI / 2))) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(new BigDec(100.0))))) {
      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
    }
    if ((operation.equals("sin") || operation.equals("tan")) && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(0.0)))
        || (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(BigDec.ZERO)) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(BigDec.ZERO)))) {
      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
    }
    if (operation.equals("sin") && (parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(360.0)).eq(new BigDec(30.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(Math.PI / 6)) || parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(33.333333)))) {
      return new ConsCell(new BigDec(0.5), ConsType.NUMBER);
View Full Code Here

    }
    if ((operation.equals("sin") || operation.equals("tan")) && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(0.0)))
        || (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(BigDec.ZERO)) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(BigDec.ZERO)))) {
      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
    }
    if (operation.equals("sin") && (parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(360.0)).eq(new BigDec(30.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(Math.PI / 6)) || parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(33.333333)))) {
      return new ConsCell(new BigDec(0.5), ConsType.NUMBER);
    }
    if (operation.equals("cos") && (parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(360.0)).eq(new BigDec(60.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(Math.PI / 3)) || parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(66.666667)))) {
View Full Code Here

    if ((operation.equals("sin") || operation.equals("tan")) && ((parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(180.0)).eq(new BigDec(0.0)))
        || (parser.getAngleType().equals("Radians") && inp.mod(new BigDec(Math.PI)).eq(BigDec.ZERO)) || (parser.getAngleType().equals("Grads") && inp.mod(new BigDec(200.0)).eq(BigDec.ZERO)))) {
      return new ConsCell(BigDec.ZERO, ConsType.NUMBER);
    }
    if (operation.equals("sin") && (parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(360.0)).eq(new BigDec(30.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(Math.PI / 6)) || parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(33.333333)))) {
      return new ConsCell(new BigDec(0.5), ConsType.NUMBER);
    }
    if (operation.equals("cos") && (parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(360.0)).eq(new BigDec(60.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(Math.PI / 3)) || parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(66.666667)))) {
      return new ConsCell(new BigDec(0.5), ConsType.NUMBER);
View Full Code Here

    }
    if (operation.equals("sin") && (parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(360.0)).eq(new BigDec(30.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(Math.PI / 6)) || parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(33.333333)))) {
      return new ConsCell(new BigDec(0.5), ConsType.NUMBER);
    }
    if (operation.equals("cos") && (parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(360.0)).eq(new BigDec(60.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(Math.PI / 3)) || parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(66.666667)))) {
      return new ConsCell(new BigDec(0.5), ConsType.NUMBER);
    }
    if (operation.equals("sin") && (parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(360.0)).eq(new BigDec(210.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(2 * Math.PI / 3)) ||
View Full Code Here

    if (operation.equals("sin") && (parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(360.0)).eq(new BigDec(30.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(Math.PI / 6)) || parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(33.333333)))) {
      return new ConsCell(new BigDec(0.5), ConsType.NUMBER);
    }
    if (operation.equals("cos") && (parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(360.0)).eq(new BigDec(60.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(Math.PI / 3)) || parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(66.666667)))) {
      return new ConsCell(new BigDec(0.5), ConsType.NUMBER);
    }
    if (operation.equals("sin") && (parser.getAngleType().equals("Degrees") && inp.mod(new BigDec(360.0)).eq(new BigDec(210.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(2 * Math.PI / 3)) ||
        parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(233.333333)))) {
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.