Skip to content

Latest commit

 

History

History
121 lines (85 loc) · 3.18 KB

File metadata and controls

121 lines (85 loc) · 3.18 KB
description
Returns the logarithm of the numeric input expression. If no base is specified, the natural log (ln) will be calculated.

LOG

Syntax

LOG(base_expression FLOAT, expression FLOAT) → DOUBLE

  • base_expression: The base to use.
  • expression: The value to calculate the log.

Examples

{% code title="LOG example" %}

SELECT LOG(20.5, 1.5)
-- 0.1342410830900514

{% endcode %}

LOG(base_expression DOUBLE, expression DOUBLE) → DOUBLE

  • base_expression: The base to use.
  • expression: The value for which you want to calculate the log.

Examples

{% code title="LOG example" %}

SELECT LOG(20.5, 1.5)
-- 0.1342410830900514

{% endcode %}

LOG(expression int64) → DOUBLE

  • expression: The value for which you want to calculate the log.

Examples

{% code title="LOG example" %}

SELECT LOG(10)
-- 2.302585092994046

{% endcode %}

LOG(base_expression int64, expression int64) → DOUBLE

  • base_expression: The base to use.
  • expression: The value for which you want to calculate the log.

Examples

{% code title="LOG example" %}

SELECT LOG(10, 2)
-- 0.30102999566398114

{% endcode %}

LOG(expression int32) → DOUBLE

  • expression: The value for which you want to calculate the log.

Examples

{% code title="LOG example" %}

SELECT LOG(10)
-- 2.302585092994046

{% endcode %}

LOG(base_expression int32, expression int32) → DOUBLE

  • base_expression: The base to use.
  • expression: The value for which you want to calculate the log.

Examples

{% code title="LOG example" %}

SELECT LOG(10, 2)
-- 0.30102999566398114

{% endcode %}

LOG(expression float) → DOUBLE

  • expression: The value for which you want to calculate the log.

Examples

{% code title="LOG example" %}

SELECT LOG(12.5)
-- 2.5257286443082556

{% endcode %}

LOG(expression double) → DOUBLE

  • expression: The value for which you want to calculate the log.

Examples

{% code title="LOG example" %}

SELECT LOG(12.5)
-- 2.5257286443082556

{% endcode %}

Usage Notes

If base_expression is 1. If base_expression expression is less than 0, NaN will be returned. If the expression input is 0, -Infinity is returned. If the expression input is less than 0, NaN will be returned.