Package lipstone.joshua.parser.types

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


          power = (ConsCell) power.getCar();
        current.getNextConsCell().remove();
        power = parser.run(parser.preProcess(power));
        if (power.getCarType() != ConsType.NUMBER || power.length() != 1)
          throw new InvalidUnitException(current.getCar() + " is raised to an invalid power.", nl);
        partial = partial.pow((BigDec) power.getCar());
      }
      factor = divide ? factor.divide(partial) : factor.multiply(partial);
    } while (!(current = current.getNextConsCell()).isNull());
    return factor;
  }
View Full Code Here


                  throw new UndefinedResultException("For stacked exponents, each subsequent exponent must evaluate to a number", null);
                num2 = num2.pow(negate ? ((BigDec) current.getNextConsCell(2).getCar()).multiply(BigDec.MINUSONE) : (BigDec) current.getNextConsCell(2).getCar());
                current.getNextConsCell().remove();
                current.getNextConsCell().remove();
              }
              output = num1.pow(num2);
            }
            else if (operator == '*')
              output = num1.multiply(num2);
            else if (operator == '/')
              output = num1.divide(num2);
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.