LN
Example
Section titled “Example”SELECT LN(2);Output
Section titled “Output”0.6931471805599453Explanation
Section titled “Explanation”In the given SQL query, the LN() function is used to compute the natural logarithm of 2. The natural logarithm of a number is the logarithm to the base e, where e is an irrational and transcendental number approximately equal to 2.718281828. The LN(2) function returns the natural logarithm of 2, approximately equal to 0.6931471805599453.
Example
Section titled “Example”SELECT LN(10);Output
Section titled “Output”2.30258509299405Explanation
Section titled “Explanation”The LN() function in PostgreSQL has returned the natural logarithm of 10, which equates to approximately 2.30258509299405. It accepts a numeric argument, evaluating the natural logarithm with the base “e” (about 2.71828).
Example
Section titled “Example”SELECT LN(2.71828) AS Logarithm_Value;Output
Section titled “Output”1.999999327347282Explanation
Section titled “Explanation”In the given example, the LN function is used to calculate the natural logarithm of the number 2.71828. The result is approximately 1.999999327347282. LN is a mathematical function available in SQL Server that returns the natural logarithm of a specified float expression.
Example
Section titled “Example”SELECT LN(1) AS natural_logarithm FROM dual;Output
Section titled “Output”NATURAL_LOGARITHM------------------0Explanation
Section titled “Explanation”The SQL code selects the natural logarithm (LN) of 1 from a sole row provided by “dual”. In mathematical terms, the natural logarithm of 1 is always 0, which is reflected in the output.