Package java.math

Examples of java.math.BigDecimal.max()


    public BigDecimal typedReduce(Key key, Iterator<BigDecimal> iter) {
      if (!iter.hasNext())
        return null;
      BigDecimal max = iter.next();
      while (iter.hasNext()) {
        max = max.max(iter.next());
      }
      return max;
    }
  }
 
View Full Code Here


            objeto = vtemp.elementAt(colx);
            bi = ObjectToBigDecimal(objeto);

            if(esFecha(tmodel.columnTypes[colx]) == false)
            {
                biColXMax = bi.max(biColXMax);
                biColXMin = bi.min(biColXMin);
            }
            else
            {
                if(tiColXMax.compareTo(new Timestamp(bi.longValue())) < 0)
View Full Code Here

                objeto = vtemp.elementAt(coly[j]);
                bi = ObjectToBigDecimal(objeto);

                if(esFecha(tmodel.columnTypes[coly[0]]) == false)
                {
                    biColYMax = bi.max(biColYMax);
                    biColYMin = bi.min(biColYMin);
                }
                else
                {
                    if(tiColYMax.compareTo(new Timestamp(bi.longValue())) < 0)
View Full Code Here

            @Override
            public BigDecimal collate(Iterable<Map.Entry<Key, BigDecimal>> values) {
                BigDecimal max = null;
                for (Map.Entry<Key, BigDecimal> entry : values) {
                    BigDecimal value = entry.getValue();
                    max = max == null ? value : value.max(max);
                }
                return max;
            }
        };
    }
View Full Code Here

        });

        BigDecimal expectation = BigDecimal.ZERO;
        for (int i = 0; i < values.length; i++) {
            Value<BigDecimal> value = values[i];
            expectation = i == 0 ? value.value : expectation.max(value.value);
        }

        Aggregation<String, BigDecimal, BigDecimal> aggregation = Aggregations.bigDecimalMax();
        BigDecimal result = testMaxWithExtractor(values, aggregation);
        assertEquals(expectation, result);
View Full Code Here

        });

        BigDecimal expectation = BigDecimal.ZERO;
        for (int i = 0; i < values.length; i++) {
            Value<BigDecimal> value = values[i];
            expectation = i == 0 ? value.value : expectation.max(value.value);
        }

        Aggregation<String, BigDecimal, BigDecimal> aggregation = Aggregations.bigDecimalMax();
        BigDecimal result = testMaxWithExtractor(values, aggregation);
        assertEquals(expectation, result);
View Full Code Here

        });

        BigDecimal expectation = BigDecimal.ZERO;
        for (int i = 0; i < values.length; i++) {
            Value<BigDecimal> value = values[i];
            expectation = i == 0 ? value.value : expectation.max(value.value);
        }

        Aggregation<String, BigDecimal, BigDecimal> aggregation = Aggregations.bigDecimalMax();
        BigDecimal result = testMaxWithExtractor(values, aggregation);
        assertEquals(expectation, result);
View Full Code Here

    // store it here
    BigDecimal norm = BigDecimal.ZERO;
   
    // go through and do stuff
    for (int j = 0; j < vector.length; j++) {
      norm = norm.max(vector[j].abs(mc));
    }
   
    // return stuff
    return norm;
  }
View Full Code Here

   
    System.out.printf("Worst error between banded and full solver\n");
    BigDecimal worstErr = BigDecimal.ZERO.setScale(precision);
    for (int i = 0; i < dim; i++)  {
      worstErr = worstErr.max(B[i].subtract(B2[i], mc).abs(mc));
    }
    System.out.println(worstErr);
   
    System.out.println("Worst relative error between A*x and b, where x is the result of solving A*x = b, upto 100 digits of precision");
    BigDecimal worstRelErr = BigDecimal.ZERO.setScale(precision);
View Full Code Here

            if(complementaryLine != null) {
                complementaryDebt = complementaryLine.getCurrentCredit();
            }
            BigDecimal rest = complementaryDebt.subtract(valueToMove);
            if(complementaryLine != null) {
                complementaryLine.setCurrentCredit(rest.max(BigDecimal.ZERO));
                complementatyLines.add(complementaryLine);
            }
            line.setCurrentCredit(line.getCurrentCredit().add(rest.negate().max(BigDecimal.ZERO)));
        }
        return complementatyLines;
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.