%uA0java.math.BigInteger.min(BigInteger val)%uA0返回BigInteger和val的最小值。
声明
以下是java.math.BigInteger.min()方法的声明
public BigInteger min(BigInteger val)
参数
-
val%uA0- 值是要计算最小值
返回值
此方法返回BigInteger,其值是BigInteger和val的最小值。如果它们相等,或者可以被返回。
异常
-
NA
例子
下面的例子显示math.BigInteger.min()方法的用法
package com.yiibai import java.math.* public class BigIntegerDemo { public static void main(String[] args) { // create 3 BigInteger objects BigInteger bi1, bi2, bi3 bi1 = new BigInteger("123") bi2 = new BigInteger("1000") // assign the min value of bi1, bi2 to bi3 bi3 = bi1.min(bi2) String str = "Minimum Value among " + bi1 + " and "+ bi2+" is "+ bi3 // print the minimum value System.out.println( str ) } }
让我们编译和运行上面的程序,这将产生以下结果:
Minimum Value among 123 and 1000 is 123