Scalar function
Returns NULL when an argument is NULL.
Syntax
Scalar
Arguments
Returns
- Type: DOUBLE for DECIMAL or integer input; FLOAT when the input is evaluated as FLOAT
- Possible values: A floating-point logarithm; invalid mathematical domains produce NaN or infinity.
- NULL behavior: Returns NULL when an argument is NULL.
Properties
- Approximation bound: No fixed maximum error is guaranteed.
Usage notes
- Decimal perfect powers at scale zero may use exact integer logarithm detection before falling back to floating point.
- 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
Change the base
Limitations
- Supply two numeric arguments. The one-argument base-10 form is not supported. An input evaluated as FLOAT returns FLOAT even when query tools report DOUBLE.
Last modified on October 15, 2026