StrictMath.log1p(): This method is available in java.lang.StrictMath class of Java.
Syntax:
double java.lang.StrictMath.log1p(double x)
This method takes one argument of type double as its parameter. This method returns the natural logarithm of the sum of the argument and 1.
Note:
1. If the argument is NaN or less than -1, then the result isNaN.
2. If the argument is positive infinity, then the result is positive infinity.
3. If the argument is negative, then the result is negative infinity.
4. If the argument is zero, then the result is a zero with the same sign as the argument.
Parameters: One parameter is required for this method.
x: a value.
Returns: the value ln(x + 1), the natural log of x + 1.
Exceptions: NA
Approach
Java
public class StrictMathlog1p {public static void main(String[] args) {double x = 19978.89;System.out.println(StrictMath.log1p(x));}}
Output:
9.902481546681884
No comments:
Post a Comment