This topic describes how to use the mathematical function LN in Realtime Compute.

Syntax

DOUBLE ln(DOUBLE number)

Input parameters

Parameter Data type
number DOUBLE
Note If the input value is of the STRING or BIGINT type, it is implicitly converted to a value of the DOUBLE type before calculation.

Description

Returns the natural logarithm of a number. The return value is a logarithm of the DOUBLE type.

Example

  • Test data
    ID (INT) X (DOUBLE)
    1 100.0
    2 8.0
  • Test statements
    SELECT id, ln(x) as dou1, ln(e()) as dou2
    FROM T1;         
  • Test results
    ID (INT) dou1 (DOUBLE) dou2 (DOUBLE)
    1 4.605170185988092 1.0.
    2 2.0794415416798357 1.0.