logarithm
static double log(double a)
- Returns the natural logarithm (base e) of a double value.
static double log10(double a)
- Returns the base 10 logarithm of a double value.
static double log1p(double x)
- Returns the natural logarithm of the sum of the argument and 1.
public class Main {
public static void main(String[] args) throws Exception {
System.out.println(Math.log(2));
}
}
The output:
0.6931471805599453
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