Raise the power
static double exp(double a)
- Raise to the power of a double value.
static double expm1(double x)
- Returns ex -1.
static double pow(double a, double b)
- a raised to the power b.
public class Main {
public static void main(String[] args) {
System.out.println(Math.exp(2));
System.out.println(Math.expm1(2.2));
System.out.println(Math.pow(2,3));
}
}
The output:
7.38905609893065
8.025013499434122
8.0
Home
Java Book
Essential Classes
Java Book
Essential Classes
Math:
- Math class
- Constant E and PI
- Get the absolute value
- sin, cos, tan: Trigonometric functions
- Cube root and square root
- Ceilling and flooring value
- Copy sign
- Raise the power
- Get exponent
- sqrt(x2 +y2)
- IEEE remainder
- logarithm
- Max, min value
- Next value
- Math Random
- Round to int to double
- Round a value to integer
- value * 2^ scaleFactor
- Get the sign
- Degree to Radian, and Radian to Degree
- Returns the size of an ulp of the argument