Skip to main content
Scalar function
Returns NULL when an argument is NULL.

Syntax

Scalar

Arguments

Returns

  • Type: DOUBLE; FLOAT when the input is evaluated as FLOAT
  • Possible values: Real logarithms for positive input; negative infinity at zero and NaN for negative input.
  • NULL behavior: Returns NULL when an argument is NULL.

Properties

  • Approximation bound: No fixed maximum error is guaranteed.

Usage notes

  • Numeric inputs are normally converted to DOUBLE for calculation. An input evaluated as FLOAT keeps FLOAT precision.
  • INTEGER and INT mean the same type; STRING means VARCHAR text. NULL can be used with a supported type. Cast NULL explicitly when its type would otherwise be unclear.
  • Exact result: Floating-point computation can round the mathematical result.

Examples

Value and NULL input

Values below and above one

Results are rounded to six decimal places for display.

Limitations

  • Zero returns negative infinity; negative input returns NaN.
  • The result is FLOAT when the input is evaluated as FLOAT, and DOUBLE after other numeric conversions. Query tools may report the original input type instead; this does not convert the result back to INTEGER or DECIMAL.
Last modified on October 15, 2026