This function is used to return the natural logarithm of a given base and exponent.
log(DOUBLE base, DOUBLE a)
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
base |
Yes |
DOUBLE, BIGINT, DECIMAL, or STRING |
The value can be a float, integer, or string. If the value is not of the DOUBLE type, the system will implicitly convert it to the DOUBLE type for calculation. |
a |
Yes |
DOUBLE, BIGINT, DECIMAL, or STRING |
The value can be a float, integer, or string. If the value is not of the DOUBLE type, the system will implicitly convert it to the DOUBLE type for calculation. |
The return value is of the DOUBLE type.
The value 2 is returned.
select log(2, 4);
The value NULL is returned.
select log(2, null);
The value NULL is returned.
select log(null, 4);