Package lipstone.joshua.parser.types

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


    }
    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)))) {
      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(240.0)) ||
View Full Code Here


        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)))) {
      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(240.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(4 * Math.PI / 3)) ||
        parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(266.666667)))) {
View Full Code Here

    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)))) {
      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(240.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(4 * Math.PI / 3)) ||
        parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(266.666667)))) {
      return new ConsCell(new BigDec(-0.5), ConsType.NUMBER);
    }
    //End special points
View Full Code Here

        parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(233.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(240.0)) ||
        parser.getAngleType().equals("Radians") && inp.eq(new BigDec(4 * Math.PI / 3)) ||
        parser.getAngleType().equals("Grads") && inp.mod(new BigDec(400.0)).eq(new BigDec(266.666667)))) {
      return new ConsCell(new BigDec(-0.5), ConsType.NUMBER);
    }
    //End special points
   
    for (String str : angleInput)
View Full Code Here

            BigDec num1 = (BigDec) current.getCar(), num2 = ((BigDec) second.getCar()).multiply(makeNegative ? BigDec.MINUSONE : BigDec.ONE), output = BigDec.ZERO;
            second.remove(); //num2
            current.getNextConsCell().remove(); //operator
           
            if (operator == '%')
              output = num1.mod(num2);
            else if (operator == '^') {
              while (current.getNextConsCell().getCarType() == ConsType.OPERATOR && (Character) current.getNextConsCell().getCar() == '^') {
                boolean negate = false;
                while (current.getNextConsCell(2).getCarType() == ConsType.OPERATOR) {
                  if ((Character) current.getNextConsCell(2).getCar() == '-')
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.