Core Java Tutorial

Core Java Tutorial

Math Example Program for getExponent(float f)

[java]
//Math Example program for getExponent(Float f)
/**
@author:candidjava.com
@Description:Returns the exponent used in the representation of a float
*/
public class getExpo
{
public static void main(String[] args)
{
//initialize the float value
float f= 5.0f;
//returns the exponent value
float y= Math.getExponent(f);
System.out.println("Exponent1 = " + y);
}
}
[/java]

OUTPUT:
Exponent1=2.0