forked from laiweijian4/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com> Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
6.7 KiB
6.7 KiB
log
This function is used to return the natural logarithm of a given base and exponent.
Syntax
log(DOUBLE base, DOUBLE a)
Parameters
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. |
Return Values
The return value is of the DOUBLE type.
Example Code
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);
Parent topic: Mathematical Functions