@Override public long distance(BigInteger start, BigInteger end) { return end.subtract(start).max(MIN_LONG).min(MAX_LONG).longValue(); }
@Override public long distance(BigInteger start, BigInteger end) { return end.subtract(start).max(MIN_LONG).min(MAX_LONG).longValue(); }
@Override public long distance(BigInteger start, BigInteger end) { return end.subtract(start).max(MIN_LONG).min(MAX_LONG).longValue(); }
@Override public long distance(BigInteger start, BigInteger end) { return end.subtract(start).max(MIN_LONG).min(MAX_LONG).longValue(); }
@Override public void value(BigInteger each) { this.count++; if (each != null) { this.sum = this.sum.add(each); this.min = this.min == null ? each : this.min.min(each); this.max = this.max == null ? each : this.max.max(each); } }
@Override public void value(BigInteger each) { this.count++; if (each != null) { this.sum = this.sum.add(each); this.min = this.min == null ? each : this.min.min(each); this.max = this.max == null ? each : this.max.max(each); } }
public BigIntegerSummaryStatistics merge(BigIntegerSummaryStatistics summaryStatistics) { this.count += summaryStatistics.count; this.sum = this.sum.add(summaryStatistics.sum); if (summaryStatistics.min != null) { this.min = this.min == null ? summaryStatistics.min : this.min.min(summaryStatistics.min); } if (summaryStatistics.max != null) { this.max = this.max == null ? summaryStatistics.max : this.max.max(summaryStatistics.max); } return this; } }
public BigIntegerSummaryStatistics merge(BigIntegerSummaryStatistics summaryStatistics) { this.count += summaryStatistics.count; this.sum = this.sum.add(summaryStatistics.sum); if (summaryStatistics.min != null) { this.min = this.min == null ? summaryStatistics.min : this.min.min(summaryStatistics.min); } if (summaryStatistics.max != null) { this.max = this.max == null ? summaryStatistics.max : this.max.max(summaryStatistics.max); } return this; } }
private static BigDecimal bcpowImpl(BigDecimal base, BigInteger exp, int scale) { if (exp.compareTo(BigInteger.ZERO) == 0) return BigDecimal.ONE; boolean isNeg; if (exp.compareTo(BigInteger.ZERO) < 0) { isNeg = true; exp = exp.negate(); } else isNeg = false; BigDecimal result = BigDecimal.ZERO; while (exp.compareTo(BigInteger.ZERO) > 0) { BigInteger expSub = exp.min(INTEGER_MAX); exp = exp.subtract(expSub); result = result.add(base.pow(expSub.intValue())); } if (isNeg) result = BigDecimal.ONE.divide(result, scale + 2, RoundingMode.DOWN); result = result.setScale(scale, RoundingMode.DOWN); if (result.compareTo(BigDecimal.ZERO) == 0) return BigDecimal.ZERO; result = result.stripTrailingZeros(); return result; }
@Override public BigInteger visitBinaryFunction(BinaryFunctionContext ctx) { BigInteger left = visit(ctx.left); BigInteger right = visit(ctx.right); switch (ctx.binaryFunctionName().name.getType()) { case MIN: return left.min(right); case MAX: return left.max(right); default: throw new IllegalArgumentException("Unsupported binary function " + ctx.binaryFunctionName().getText()); } }
@Override BigInteger apply(BigInteger left, BigInteger right) { return left.min(right); } }
max = (max == null ? peg : max.min(peg));
BigInteger combine(BigInteger orig, BigInteger copy, BigInteger other) { if (this == ADD) { return copy == null && orig == null ? null : safeBigInt(copy).add(safeBigInt(orig)); } else if (this == MAX) { return copy == null && orig == null ? null : safeBigInt(copy).max(safeBigInt(orig)); } else if (this == MIN) { return copy == null && orig == null ? null : safeBigInt(copy).max(safeBigInt(orig)); } else if (this == ADD_OTHER) { return copy == null && orig == null && other == null ? null : safeBigInt(copy).add(safeBigInt(orig).add(safeBigInt(other))); } else if (this == MAX_OTHER) { return copy == null && orig == null && other == null ? null : safeBigInt(copy).max(safeBigInt(orig).max(safeBigInt(other))); } else if (this == MIN_OTHER) { return copy == null && orig == null && other == null ? null : safeBigInt(copy).min(safeBigInt(orig).min(safeBigInt(other))); } else if (this == RANGE) { return copy == null && orig == null && other == null ? null : safeBigInt(copy).max(safeBigInt(orig).min(safeBigInt(other))); } else { return copy; } } }
private BigInteger min(BigInteger a, BigInteger b) { if(a==null) return b; if(b==null) return a; return a.min(b); }
@Override public void reduce(BigInteger value) { min = min == null ? value : value.min(min); }
public SNMPGauge32(long newValue) { tag = SNMPBERCodec.SNMPGAUGE32; value = new BigInteger(new Long(newValue).toString()); // peg if value > maxValue value = value.min(maxValue); }
minOccurs = minOccurs.min(from.getMinOccurs()); if (maxOccurs != null) maxOccurs = (from.getMaxOccurs() == null ? null :
final BigInteger[] divideAndRemainder = indentDiff.divideAndRemainder(BigInteger.valueOf(20)); BigInteger space = safeBigInt(leftBorder.getSpace()).add(divideAndRemainder[0]).min(BigInteger.valueOf(31)); leftBorder.setSpace(space);
@Override public void value(BigInteger each) { this.count++; if (each != null) { this.sum = this.sum.add(each); this.min = this.min == null ? each : this.min.min(each); this.max = this.max == null ? each : this.max.max(each); } }
@Override public long distance(BigInteger start, BigInteger end) { return end .subtract(start) .max(MIN_LONG) .min(MAX_LONG) .longValue(); }