## Examples of divide()

### Examples of java.math.BigDecimal.divide()

 `141142143144145146147148149150151` ```        if (values.size() % 2 == 1)           return values.get(values.size() / 2);         BigDecimal bd = new BigDecimal(             values.get(values.size() / 2 - 1));         bd = bd.add(new BigDecimal(values.get(values.size() / 2)));         return bd.divide(new BigDecimal(2)).floatValue();       case MODE:         Hashtable map =             new Hashtable();         for (int i = 0; i < values.size(); ++i) {           int prev = 0; ```
View Full Code Here

### Examples of java.math.BigDecimal.divide()

 `134135136137138139140141142143144` ```        if (values.size() == 1)           return values.get(0);         BigDecimal total = new BigDecimal(0);         for (int i = 0; i < values.size(); ++i)           total = total.add(BigDecimal.valueOf(values.get(i)));         return total.divide(BigDecimal.valueOf((long)values.size()), 10, RoundingMode.HALF_EVEN).doubleValue();       case MEDIAN:         if (values.size() % 2 == 1)           return values.get(values.size() / 2);         BigDecimal bd = new BigDecimal(             values.get(values.size() / 2 - 1)); ```
View Full Code Here

### Examples of java.math.BigDecimal.divide()

 `141142143144145146147148149150151` ```        if (values.size() % 2 == 1)           return values.get(values.size() / 2);         BigDecimal bd = new BigDecimal(             values.get(values.size() / 2 - 1));         bd = bd.add(new BigDecimal(values.get(values.size() / 2)));         return bd.divide(new BigDecimal(2)).doubleValue();       case MODE:         Hashtable map =             new Hashtable();         for (int i = 0; i < values.size(); ++i) {           int prev = 0; ```
View Full Code Here

### Examples of java.math.BigDecimal.divide()

 `134135136137138139140141142143144` ```        if (values.size() == 1)           return values.get(0);         BigDecimal total = new BigDecimal(0);         for (int i = 0; i < values.size(); ++i)           total = total.add(values.get(i));         return total.divide(BigDecimal.valueOf(values.size()), RoundingMode.HALF_UP);       case MEDIAN:         if (values.size() % 2 == 1)           return values.get(values.size() / 2);         BigDecimal bd = values.get(values.size() / 2 - 1);         bd = bd.add(values.get(values.size() / 2)); ```
View Full Code Here

### Examples of java.math.BigDecimal.divide()

 `140141142143144145146147148149150` ```      case MEDIAN:         if (values.size() % 2 == 1)           return values.get(values.size() / 2);         BigDecimal bd = values.get(values.size() / 2 - 1);         bd = bd.add(values.get(values.size() / 2));         return bd.divide(new BigDecimal(2));       case MODE:         Hashtable map =             new Hashtable();         for (int i = 0; i < values.size(); ++i) {           int prev = 0; ```
View Full Code Here

### Examples of java.math.BigDecimal.divide()

 `345346347348349350351352353354355` ```        if (size % 2 == 1) {             return bigDecimalNumbers[start + (size + 1) / 2 - 1];         } else {             BigDecimal result = bigDecimalNumbers[start + (size) / 2 - 1];             result = result.add(bigDecimalNumbers[start + (size) / 2]);             return result.divide(BigDecimal.valueOf(2));         }     }     private static BigDecimal quartile1(BigDecimal[] bigDecimalNumbers) {         final int size = bigDecimalNumbers.length; ```
View Full Code Here

### Examples of java.math.BigDecimal.divide()

 `11211122112311241125112611271128112911301131` ```                    BigDecimal usageCostAmount = ZERO;                     if (usageCost != null) {                         usageCostAmount = usageCost.getBigDecimal("amount").multiply(BigDecimal.valueOf(actualMilliSeconds.doubleValue()));                     }                     BigDecimal fixedAssetCost = setupCostAmount.add(usageCostAmount).setScale(decimals, rounding);                     fixedAssetCost = fixedAssetCost.divide(BigDecimal.valueOf(3600000), decimals, rounding);                     // store the cost                     Map inMap = UtilMisc.toMap("userLogin", userLogin,                             "workEffortId", productionRunTaskId);                     inMap.put("costComponentTypeId", "ACTUAL_ROUTE_COST");                     inMap.put("costUomId", currencyUomId); ```
View Full Code Here

### Examples of java.math.BigDecimal.divide()

 `2829303132333435363738` ```                // divide       x = new BigDecimal("6.9609119610E-78");         y = new BigDecimal("4E-48");       r = x.divide(y, 40, 6);                     // ROUND_HALF_EVEN       System.out.println( r.toString() );       // 1.7402279902E-30                 x = new BigDecimal("5.383458817E-83"); ```
View Full Code Here

### Examples of java.math.BigDecimal.divide()

 `3536373839404142434445` ```      // 1.7402279902E-30                 x = new BigDecimal("5.383458817E-83");         y = new BigDecimal("8E-54");         r = x.divide(y, 40, 6);         System.out.println( r.toString() );         // 6.7293235212E-30                 // compareTo ```
View Full Code Here

### Examples of java.math.BigDecimal.divide()

 `244245246247248249250251252253254` ```            final BigDecimal MB = new BigDecimal(1000L * 1000);             final BigDecimal GB = new BigDecimal(1000L * 1000 * 1000);             BigDecimal bd = new BigDecimal(value);             if (bd.compareTo(GB) > 0) {                 bd = bd.divide(GB);                 suffix = "GB";             } else if (bd.compareTo(MB) > 0) {                 bd = bd.divide(MB);                 suffix = "MB";             } else if (bd.compareTo(KB) > 0) { ```
View Full Code Here