## `LOG()` 语法

``````LOG(number)
LOG(base, number)
``````

`LOG(number)` 函数等同于 `LN(number)` 函数。

`number`

`base`

### 返回值

MariaDB `LOG()` 函数返回指定数字的指定底数的对数。

## MariaDB `LOG()` 示例

``````SELECT
LOG(1),
LOG(EXP(1), 1),
LOG(2),
LOG(EXP(1), 2),
LOG(2, 16),
LOG(10, 100),
LOG(0),
LOG(-1),
LOG(1, 10),
LOG(NULL)\G
``````

``````        LOG(1): 0
LOG(EXP(1), 1): 0
LOG(2): 0.6931471805599453
LOG(EXP(1), 2): 0.6931471805599453
LOG(2, 16): 4
LOG(10, 100): 2
LOG(0): NULL
LOG(-1): NULL
LOG(1, 10): NULL
LOG(NULL): NULL``````
{"ft_lang_label":"__label__zh","ft_lang_prob":0.7040096,"math_prob":0.9999931,"size":908,"snap":"2023-40-2023-50","text_gpt3_token_len":501,"char_repetition_ratio":0.1880531,"word_repetition_ratio":0.016393442,"special_character_ratio":0.4030837,"punctuation_ratio":0.17010309,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9732366,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-09-26T05:06:25Z\",\"WARC-Record-ID\":\"<urn:uuid:6bd0e0e1-68ba-4210-bb8b-69703c0d9412>\",\"Content-Length\":\"84732\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:0ec84b5c-8231-438a-812b-3cccd1f5f882>\",\"WARC-Concurrent-To\":\"<urn:uuid:6f6027b7-f192-48b5-8984-c45ae320b57d>\",\"WARC-IP-Address\":\"104.21.69.134\",\"WARC-Target-URI\":\"https://www.sjkjc.com/mariadb-ref/log/\",\"WARC-Payload-Digest\":\"sha1:KJKTBYYG262ANMGTPXMP5TBXPZHGTELZ\",\"WARC-Block-Digest\":\"sha1:A5T5GRPXZP4JD3R23A4MYF7CINZN6VR2\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233510149.21_warc_CC-MAIN-20230926043538-20230926073538-00570.warc.gz\"}"}