LN(), LOG()

Documentation

VoltDB Home » Documentation » Using VoltDB

LN(), LOG()

LN(), LOG() — Returns the natural logarithm of a numeric value.

Synopsis

LN( numeric-value )

LOG( numeric-value )

Description

The LN() function returns the natural logarithm of the specified input value. The log is returned as a floating point (FLOAT) value. LN() and LOG() are synonyms and perform the same function.

Example

The following example uses the LN() function to calculate the rate of population growth from census data.

SELECT  city, current_population,
    ( ( LN(current_population) - LN(base_population) )
       / (current_year - base_year) 
    ) * 100.0 AS percent_growth
    FROM  census ORDER BY city;