Home >>Java Math Methods >Java Math.getExponent() method
The Math.getExponent() Method is used to returns the unbiased exponent that was used in double or float representation.
public static int getExponent(float x) public static int getExponent(double x)
x = This parameter is used for a value
It is used to returns the unbiased exponent of the argument.
public class MyClass
{
public static void main(String[] args)
{
double x = 35.12;
System.out.println(Math.getExponent(x));
}
}
public class MyClass
{
public static void main(String[] args)
{
float x = 14.5f;
System.out.println(Math.getExponent(x));
}
}