Share via


Math.min

Class Overview | Class Members | This Package | All Packages

Syntax 1

public static int min( int a**, int** b )

Parameters
  • a
    an int value.
  • b
    an int value.
Returns

the smaller of a and b.

Description

Returns the smaller of two int values.

Syntax 2

public static long min( long a**, long** b )

Parameters
  • a
    a long value.
  • b
    a long value.
Returns

the smaller of a and b.

Description

Returns the smaller of two long values.

Syntax 3

public static float min( float a**, float** b )

Parameters
  • a
    a float value.
  • b
    a float value.
Returns

the smaller of a and b.

Description

Returns the smaller of two float values. If either value is NaN, then the result is NaN. Unlike the the numerical comparison operators, this method considers negative zero to be strictly smaller than positive zero.

Syntax 4

public static double min( double a**, double** b )

Parameters
  • a
    a double value.
  • b
    a double value.
Returns

the smaller of a and b.

Description

Returns the smaller of two double values. If either value is NaN, then the result is NaN. Unlike the the numerical comparison operators, this method considers negative zero to be strictly smaller than positive zero.