log Summary Returns the natural logarithm (with base e) for a value. Signatures Click on a signature to select it and view its documentation. public static double log(double value) public static double log(double value, double base) Usage public static double log(double value) public static double log(double value, double base) Returns The natural logarithm for the value. If the supplied value is negative, the result is NaN. If the supplied value is zero (0) then the result is negative infinity. The logarithm with the specified base for the value. Parameters value A positive number to evaluate the natural logarithm for. Parameters value A positive number to evaluate the logarithm with the specified base for. base The base for the logarithm. Description Returns the natural logarithm (with base e) for a value. Mathematically, this would be represented as ln(x). The input must be a positive number. For negative inputs, this method will return NaN. For a zero (0) input, this method will return negative infinity. Returns the logarithm with the specified base for a value. The input value and base must be positive numbers. Examples Basic Usage 123import System; Console.log(Math.log(10)); Basic Usage 123import System; Console.log(Math.log(10, 2)); Share HTML | BBCode | Direct Link