Java Math getExponent() Method

The getExponent() method of Math class returns the unbiased exponent of the argument.

Syntax:

public static int  getExponent (double d)

Parameters:

The parameter ‘d’ represents the double value.

Return Value:

The getExponent () method returns the unbiased exponent used in the representation of a double.

Special cases are as follows:

  • It returns Double.MAX_EXPONENT+1, if the argument is NaN or infinite.
  • It returns Double.MIN_EXPONENT-1, if the argument is zero or subnormal.

Example 1:

Output:

Example 2:

Output:

Example 3:

Output:

Example 4:

Output: