java.math.BigInteger.max()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中java.math.BigInteger.max()方法的一些代码示例,展示了BigInteger.max()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BigInteger.max()方法的具体详情如下:
包路径:java.math.BigInteger
类名称:BigInteger
方法名:max

BigInteger.max介绍

[英]Returns the maximum of this BigInteger and value.
[中]返回此BigInteger和值的最大值。

代码示例

代码示例来源:origin: google/guava

@Override
public long distance(BigInteger start, BigInteger end) {
 return end.subtract(start).max(MIN_LONG).min(MAX_LONG).longValue();
}

代码示例来源:origin: prestodb/presto

@Override
public long distance(BigInteger start, BigInteger end) {
 return end.subtract(start).max(MIN_LONG).min(MAX_LONG).longValue();
}

代码示例来源:origin: google/j2objc

@Override
public long distance(BigInteger start, BigInteger end) {
 return end.subtract(start).max(MIN_LONG).min(MAX_LONG).longValue();
}

代码示例来源:origin: wildfly/wildfly

@Override
public long distance(BigInteger start, BigInteger end) {
 return end.subtract(start).max(MIN_LONG).min(MAX_LONG).longValue();
}

代码示例来源:origin: eclipse/eclipse-collections

@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);
  }
}

代码示例来源:origin: eclipse/eclipse-collections

@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);
  }
}

代码示例来源:origin: eclipse/eclipse-collections

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;
  }
}

代码示例来源:origin: eclipse/eclipse-collections

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;
  }
}

代码示例来源:origin: prestodb/presto

@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());
  }
}

代码示例来源:origin: hcoles/pitest

@Override
 BigInteger apply(BigInteger left, BigInteger right) {
  return left.max(right);
 }
}

代码示例来源:origin: ethereum/ethereumj

BigInteger in = memNeeded(stack.get(stack.size() - opOff), stack.get(stack.size() - opOff - 1)); // in offset+size
BigInteger out = memNeeded(stack.get(stack.size() - opOff - 2), stack.get(stack.size() - opOff - 3)); // out offset+size
gasCost += calcMemGas(gasCosts, oldMemSize, in.max(out), 0);

代码示例来源:origin: org.elasticsearch/elasticsearch

BigInteger estShardSizeInBytes = BigInteger.valueOf(avgShardSizeInBytes).max(totFreeSpace.divide(BigInteger.valueOf(20)));

代码示例来源:origin: vsch/flexmark-java

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;
    }
  }
}

代码示例来源:origin: vsch/flexmark-java

@Override
public void addBlankLines(final int count) {
  if (count > 0) {
    // now add empty for spacing
    PPr pPr = myFactory.createPPr();
    myBlockFormatProvider.getPPr(pPr);
    PPr explicitPPr = myDocxHelper.getExplicitPPr(pPr);
    final ParaRPr rPr = explicitPPr.getRPr();
    BigInteger size = rPr.getSz().getVal().max(rPr.getSzCs().getVal());
    addBlankLine(size.multiply(BigInteger.valueOf(count)), null);
  }
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

if (peg != null)
  min = (min == null ? peg.negate() : min.max(peg.negate()));
  max = (max == null ? peg : max.min(peg));
  max = max.negate().subtract(BigInteger.ONE);
max = max.max(min);
if (max.compareTo(BigInteger.valueOf(Byte.MAX_VALUE)) <= 0)
  return SchemaType.SIZE_BYTE;

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

if (maxOccurs != null)
  maxOccurs = (from.getMaxOccurs() == null ? null :
          maxOccurs.max(from.getMaxOccurs()));

代码示例来源:origin: vsch/flexmark-java

child.getInd().setLeft(ZERO.max(safeIndLeft(cInd).subtract(BigInteger.valueOf(remainder))));

代码示例来源:origin: org.eclipse.collections/eclipse-collections

@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);
  }
}

代码示例来源:origin: KostyaSha/yet-another-docker-plugin

@Override
public long distance(BigInteger start, BigInteger end) {
 return end
   .subtract(start)
   .max(MIN_LONG)
   .min(MAX_LONG)
   .longValue();
}

代码示例来源:origin: locationtech/geowave

private static BigInteger clamp(
  final BigInteger minValue,
  final BigInteger maxValue,
  final BigInteger value) {
 return value.max(minValue).min(maxValue);
}

相关文章

微信公众号

最新文章

更多