Home >>Java Math Methods >Java Math.log1() method
The Math.log1p() method in Java Math is used to return the sum of the arguments and the natural logarithm 1.
public static double log1p(double x)
x= This parameter is used for a double value
It is used to returns the value ln(x + 1), the natural log of x + 1
public class MyClass
{
public static void main(String[] args)
{
double a = 12;
System.out.println(Math.log1p(a));
}
}
public class MyClass
{
public static void main(String[] args)
{
double a = -3.14;
System.out.println(Math.log1p(a));
}
}