One - One Code All

Blog Content

python计算math.log

Python   2009-12-02 22:05:05

Python log() 函数

Python 数字 Python 数字

描述

log() 返回 x 的自然对数。

语法

以下是 log() 方法的语法:

import math

math.log(x[, base])

注意:log()是不能直接访问的,需要导入 math 模块,通过静态对象调用该方法。

参数

    x -- 数值表达式。
    base -- 可选,底数,默认为 e。
    
    返回值
    返回 x 的自然对数,x>0。


上一篇:python计算math.exp
下一篇:python迭代器与生成器

The minute you think of giving up, think of the reason why you held on so long.