Return the natural logarithm of different numbers:
System. |
The log() method in Java computes the natural logarithm of a given number, where the base of the logarithm is the mathematical constant e (approximately 2.718282), which is accessible in Java through the Math.E constant.
public |
Parameter |
Description |
number |
The parameter of the log() method specifies the value for which the logarithm is calculated. If this value is negative, the method returns NaN (Not a Number). If the value is 0, it returns -Infinity. |
Return |
The log() method returns a double value representing the natural logarithm of a given number. |
Java Version |
Any |