DB2 Version 10.1 for Linux, UNIX, and Windows

LOG10 scalar function

The LOG10 function returns the common logarithm (base 10) of a number.

Read syntax diagramSkip visual syntax diagram
>>-LOG10--(--expression--)-------------------------------------><

The schema is SYSIBM. (The SYSFUN version of the LOG10 function continues to be available.)

expression
An expression that returns a value of any built-in numeric data type. If the value is of decimal floating-point data type, the operation is performed in decimal floating-point; otherwise, the value is converted to double-precision floating-point for processing by the function. The value of the argument must be greater than zero (SQLSTATE 22003).

If the argument is DECFLOAT(n), the result is DECFLOAT(n); otherwise, the result is a double-precision floating-point number. The result can be null; if the argument is null, the result is the null value.

Notes

Example

Assume that L is a DECIMAL(4,2) host variable with a value of 31.62.
   VALUES LOG10(:L)
Returns the DOUBLE value +1.49996186559619E+000.