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

Wayan Saryada

A programmer, runner, recreational diver, currently living in the island of Bali, Indonesia. Mostly programming in Java, creating web based application with Spring Framework, JPA, etc. If you need help on Java programming you can hire me on Fiverr.
Wayan Saryada

Leave a Reply