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 create a string of repeated characters? - September 1, 2023
- How do I convert datetime string with optional part to a date object? - August 28, 2023
- How do I split large excel file into multiple smaller files? - April 15, 2023