Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Data Types and Expressions > Expression >

Exponential and Logarithmic Functions

Exponential and logarithmic functions take at least one argument and return a FLOAT data type.

Read syntax diagramSkip visual syntax diagramExponential and Logarithmic Functions:
 
|--+-EXP--(--float_expression--)---+----------------------------|
   +-LOGN--(--float_expression--)--+
   '-LOG10--(--float_expression--)-'
 

Element Description Restrictions Syntax
float_expression An argument to the EXP, LOGN, or LOG10 functions. For the meaning of float_expression in these functions, see the individual heading for each function on the pages that follow. The domain is the set of real numbers, and the range is the set of positive real numbers Expression, p. Expression

EXP Function

The EXP function returns the exponent of a numeric expression. The following example returns the exponent of 3 for each row of the angles table:

SELECT EXP(3) FROM angles

For this function, the base is always e, the base of natural logarithms, as the following example shows:

e=exp(1)=2.718281828459

When you want to use the base of natural logarithms as the base value, use the EXP function. If you want to specify a particular value to raise to a specific power, see the POW Function.

LOG10 Function

The LOG10 function returns the log of a value to base 10. The following example returns the log base 10 of distance for each row of the travel table:

SELECT LOG10(distance) + 1 digits FROM travel

LOG10 Function

The LOG10 function returns the log of a value to base 10. The following example returns the log base 10 of distance for each row of the travel table:

SELECT LOG10(distance) + 1 digits FROM travel

LOGN Function

The LOGN function returns the natural logarithm of a numeric argument. This value is the inverse of the exponential value. The following query returns the natural log of population for each row of the history table:

SELECT LOGN(population) FROM history WHERE country='US'
   ORDER BY date
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]