LN()
LN() is a SQL function in the Numeric Functions category. Returns the natural logarithm (base e) of a number. The inverse of EXP(). The syntax is LN(number). It accepts number. It returns natural logarithm. A typical example: SELECT LN(2.718); -- ~1 (natural log of e) SELECT LN(100); -- ~4.605 (natural log of 100) -- LOG10 (base 10): SELECT LOG10(100); -- 2 -- LOG(base, number) in PostgreSQL: SELECT LOG(2, 1024); -- 10 (log base 2 of 1024) -- Use cases: -- Compounding interest calculations -- Data normalization -- Information theory (entropy calculations) A close relative is ROUND(), which rounds a number to a specified number of decimal places. A close relative is ABS(), which returns the absolute (positive) value of a number. A close relative is CEIL() / CEILING(), which returns the smallest integer greater than or equal to a number (rounds up). More about this category: Mathematical functions — ROUND, ABS, CEIL, FLOOR, POWER, SQRT, MOD.