How do I get the exponent of exponential function?
Date: 2010-10-21. Category: java.math examples. Hits: 3K time(s).
The exponential function is f(x) = ex. The Math.getExponent() method is used to get the x value of the given parameter, in which the parameter is a result of exponential function calculation.
package org.kodejava.example.math;
public class GetExponent {
public static void main(String[] args) {
double fx = 1.0d;
float fx1 = 1.0f;
int x = Math.getExponent(fx);
System.out.println("Exponent = " + x);
//
// argument in float
//
int xf = Math.getExponent(fx1);
System.out.println("Exponent1 = " + xf);
}
}