The exponential function is f(x) = e
x
. 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.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);
}
}
Latest posts by Wayan (see all)
- How do I get number of each day for a certain month in Java? - September 8, 2024
- How do I get operating system process information using ProcessHandle? - July 22, 2024
- How do I sum a BigDecimal property of a list of objects using Java Stream API? - July 22, 2024