Package java.math

Examples of java.math.BigDecimal.multiply()


         r__1 = r;

         int i_x2_p1 = 2 * i + 1;
         r = r.add(
                 (p.multiply(angle.pow(i_x2_p1))).divide(fact(i_x2_p1), scale, java.math.RoundingMode.FLOOR));
         p = p.multiply(NMB__1);
         i++;

         if (++_INT_ITERATIONS_ >= _INT_MAX_ITERATIONS_)
         {
            System.out.println("Iter : " + i);
View Full Code Here


     
      BigDecimal r = NMB_0;
      BigDecimal r__1 = NMB_0;
      int i = 0;
      BigDecimal p = NMB__1;
      p = p.multiply(NMB__1);


      _INT_ITERATIONS_ = 0;
      boolean more = true;
      while (more)
View Full Code Here

      while (more)
      {
         r__1 = r;
         int i_x2 = 2 * i;
         r = r.add(
                 (p.multiply(angle.pow(i_x2))).divide(fact(i_x2), scale, _INT_ROUNDING_MODE_));
         p = p.multiply(NMB__1);
         i++;

         if (++_INT_ITERATIONS_ >= _INT_MAX_ITERATIONS_)
         {
View Full Code Here

      {
         r__1 = r;
         int i_x2 = 2 * i;
         r = r.add(
                 (p.multiply(angle.pow(i_x2))).divide(fact(i_x2), scale, _INT_ROUNDING_MODE_));
         p = p.multiply(NMB__1);
         i++;

         if (++_INT_ITERATIONS_ >= _INT_MAX_ITERATIONS_)
         {
            System.out.println("Iter : " + i);
View Full Code Here

         lastGuess = guess;
         guess = n.divide(guess, scale, _INT_ROUNDING_MODE_);
         guess = guess.add(lastGuess);
         guess = guess.divide(NMB_2, scale, _INT_ROUNDING_MODE_);

         _BDM_ERROR_ = n.subtract(guess.multiply(guess));
         if (++_INT_ITERATIONS_ >= _INT_MAX_ITERATIONS_)
         {
            System.out.println("Iter : " + _INT_ITERATIONS_ );
            more = false;
         }
View Full Code Here

   {
      BigDecimal r = NMB_0;
      BigDecimal r__1 = NMB_0;
      int i = 0;
      BigDecimal p = NMB__1;
      p = p.multiply(NMB__1);
     
      // Iterate
      boolean more = true;
      while (more)
      {
View Full Code Here

        Map<Long, CalculationPriceSetItemDto> typeIdToCalculationPriceSetItemMap = new TreeMap<Long, CalculationPriceSetItemDto>();
        for (CalculationTreeNode node : calculationTree.getNodeMap().values()) {
            rootNodePrice = rootNodePrice.add(recursivelyApplyPrices(typeIdToCalculationPriceSetItemMap, existingTypeIdToCalculationPriceSetItemMap, quantity, node));
        }
        PricingProcessorResult pricingProcessorResult = new PricingProcessorResult();
        pricingProcessorResult.setTotalPrice(rootNodePrice.multiply(BigDecimal.valueOf(quantity)));
        pricingProcessorResult.setTypeIdToCalculationPriceSetItemMap(typeIdToCalculationPriceSetItemMap);
        return pricingProcessorResult;
    }

    private BigDecimal recursivelyApplyPrices(Map<Long, CalculationPriceSetItemDto> typeIdToCalculationPriceSetItemMap, Map<Long, CalculationPriceSetItemDto> existingTypeIdToCalculationPriceSetItemMap, Long parentQuantity, CalculationTreeNode calculationTreeNode) {
View Full Code Here

            BigDecimal nodePrice = BigDecimal.ZERO;
            for (CalculationTreeNode node : calculationTreeNode.getNodeMap().values()) {
                nodePrice = nodePrice.add(recursivelyApplyPrices(typeIdToCalculationPriceSetItemMap, existingTypeIdToCalculationPriceSetItemMap, quantity * parentQuantity, node));
            }
            calculationItem.setPrice(nodePrice);
            totalPrice = totalPrice.add(nodePrice.multiply(BigDecimal.valueOf(calculationItem.getQuantity())).multiply(calculationItem.getDamagePerJob()));
            calculationItem.setTotalPrice(totalPrice);
            BigDecimal totalPriceForParent = totalPrice.multiply(BigDecimal.valueOf(parentQuantity));
            calculationItem.setTotalPriceForParent(totalPriceForParent);
        }
        return totalPrice;
View Full Code Here

    if ( value==null || value.length()==0 ) {
      result.put(fieldName, "");
    } else {
      BigDecimal bdvalue = new BigDecimal(value);
      bdvalue = bdvalue.multiply(new BigDecimal("100")).setScale(0,RoundingMode.HALF_UP);
      result.put(fieldName, bdvalue.toPlainString());
    }
    }

    private void evaluateDecode(String fieldName, List<String> commandParams, List<String> colName, List<String> colValue, Map<String, String> result) throws T24Exception {
View Full Code Here

     if(value1==null || "".equals(value1) || value2==null || "".equals(value2)){
          result.put(fieldName, "");
      return;
    }
    BigDecimal bdec = new BigDecimal(value1);
    bdec = bdec.multiply(new BigDecimal(value2));
    bdec = bdec.multiply(new BigDecimal("0.01")).setScale(2,RoundingMode.HALF_UP);
    if(fromCent){
      bdec = bdec.multiply(new BigDecimal("0.01")).setScale(2,RoundingMode.HALF_UP);
    }
   
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.