How do I get the exponent of exponential function?

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.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);
    }
}
Wayan

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.