Java BigDecimal min() method

The min() method of java BigDecimal class is used to obtain the minimum value between BigDecimal and val.

Syntax:

Parameter:

Val: value with which the minimum is to be computed.

Exception:

No

Returns:

It returns minimum value between two BigDecimal values. In case if both are equal, first BigDecimal will returned.

Example 1

Test it Now

Output:

Minimum Value among 537 and 535 is = 535

Example 2

Test it Now

Output:

Minimum Value among -1133 and -1135 is = -1135

Example 3

Test it Now

Output:

Minimum Value among 657.30078 and 657.30087 is = 657.30078

Example 4

Test it Now

Output:

Minimum Value among 443 and 443 is = 443

Next TopicJava BigDecimal




Latest Courses