Math.log(x)则可,看API文档即可,以后这种问题最好自己查查public static double log(double a)Returns the natural logarithm (base e) of a double value. Special cases: If the argument is NaN or less than zero, then the result is NaN. If the argument is positive infinity, then the result is positive infinity. If the argument is positive zero or negative zero, then the result is negative infinity. A result must be within 1 ulp of the correctly rounded result. Results must be semi-monotonic. Parameters: a - a number greater than 0.0. Returns: the value ln a, the natural logarithm of a.
If the argument is NaN or less than zero, then the result is NaN.
If the argument is positive infinity, then the result is positive infinity.
If the argument is positive zero or negative zero, then the result is negative infinity.
A result must be within 1 ulp of the correctly rounded result. Results must be semi-monotonic.
Parameters:
a - a number greater than 0.0.
Returns:
the value ln a, the natural logarithm of a.