## Examples of divide()

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

 `247248249250251252253254255256257` ```            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) {                 bd = bd.divide(KB);                 suffix = "kB";             } else { ```
View Full Code Here

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

 `250251252253254255256257258259260` ```                suffix = "GB";             } else if (bd.compareTo(MB) > 0) {                 bd = bd.divide(MB);                 suffix = "MB";             } else if (bd.compareTo(KB) > 0) {                 bd = bd.divide(KB);                 suffix = "kB";             } else {                 suffix = "B";             }             suffixedValue = bd.setScale(2, RoundingMode.UP).toString(); ```
View Full Code Here

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

 `4243444546474849505152` ```     * @param context the MathContext.      * @return the mean of the numbers.      */     public static BigDecimal mean(List numbers, MathContext context) {         BigDecimal sum = sum(numbers);         return sum.divide(new BigDecimal(numbers.size()), context);     }     /**      * Returns the min number in the numbers list.      *   ```
View Full Code Here

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

 `134135136137138139140141142143144` ```        for (BigDecimal number : numbers) {             BigDecimal XminMean = number.subtract(mean);             squares.add(XminMean.pow(2, context));         }         BigDecimal sum = sum(squares);         return sum.divide(new BigDecimal(biasCorrected ? numbers.size() - 1 : numbers.size()), context);     }     /**      * Calcualtes the square root of the number. ```
View Full Code Here

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

 `306307308309310311312313314315316` ```            return IntegerValue.makeIntegerValue(hour);         case Component.MINUTES:             return IntegerValue.makeIntegerValue(minute);         case Component.SECONDS:             BigDecimal d = BigDecimal.valueOf(microsecond);             d = d.divide(DecimalValue.BIG_DECIMAL_ONE_MILLION, 6, BigDecimal.ROUND_HALF_UP);             d = d.add(BigDecimal.valueOf(second));             return new DecimalValue(d);         case Component.WHOLE_SECONDS: //(internal use only)             return IntegerValue.makeIntegerValue(second);         case Component.MICROSECONDS: ```
View Full Code Here

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

 `125126127128129130131132133134135` ```     public SimpleBigDecimal divide(SimpleBigDecimal b)     {         checkScale(b);         BigInteger dividend = bigInt.shiftLeft(scale);         return new SimpleBigDecimal(dividend.divide(b.bigInt), scale);     }     public SimpleBigDecimal divide(BigInteger b)     {         return new SimpleBigDecimal(bigInt.divide(b), scale); ```
View Full Code Here

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

 `133134135136137138139140141142143` ```        if (values.size() == 1)           return values.get(0);         BigInteger total = BigInteger.valueOf(0);         for (int i = 0; i < values.size(); ++i)           total = total.add(BigInteger.valueOf(values.get(i)));         return total.divide(BigInteger.valueOf(values.size())).byteValue();       case MEDIAN:         if (values.size() % 2 == 1)           return values.get(values.size() / 2);         BigInteger bi = BigInteger.valueOf(values.get(                 values.size() / 2 - 1)); ```
View Full Code Here

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

 `140141142143144145146147148149150` ```        if (values.size() % 2 == 1)           return values.get(values.size() / 2);         BigInteger bi = BigInteger.valueOf(values.get(                 values.size() / 2 - 1));         bi = bi.add(BigInteger.valueOf(values.get(values.size() / 2)));         return bi.divide(BigInteger.valueOf(2)).byteValue();       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.BigInteger.divide()

 `133134135136137138139140141142143` ```        if (values.size() == 1)           return values.get(0);         BigInteger total = BigInteger.valueOf(0);         for (int i = 0; i < values.size(); ++i)           total = total.add(BigInteger.valueOf(values.get(i)));         return total.divide(BigInteger.valueOf(values.size())).intValue();       case MEDIAN:         if (values.size() % 2 == 1)           return values.get(values.size() / 2);         BigInteger bi = BigInteger.valueOf(values.get(                 values.size() / 2 - 1)); ```
View Full Code Here

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

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