Java BigInteger min() Method

The min() method of Java BigInteger class is used to get the minimum value of the two BigInteger objects. This method returns the BigInteger whose value is the lesser of this BigInteger and the val method argument.

Syntax:

Parameter:

val - value with which the minimum is to be computed.

Exception:

NA

Returns:

This method returns the BigInteger whose value is the lesser between this and val.

  • If this and val both are equal, either may be returned.
  • If this is less than val, this will be returned.
  • If val is less than this, val will be returned.

Example 1

Test it Now

Output:

Minimum value among 12345 and 12345 is 12345

Example 2

Test it Now

Output:

Minimum value among 100 and 10 is 10

Example 3

Test it Now

Output:

Minimum value among -100 and -10 is -100

Next TopicJava BigInteger




Latest Courses