IT入门 > 教程 > python >
  • Python math.ldexp() 方法 日期:2022-09-11 点击:7183 python

    Python math.ldexp(x, i) 方法返回 x * (2**i), math.frexp() 的反函数。 Python 版本:2.6 语法 math.ldexp() 方法语法如下: math.ldexp(x, i) 参数说明: x -- 必需,一个正数或负数。如果值不是数字,则返...

  • Python math.lgamma() 方法 日期:2022-09-11 点击:6798 python

    Python math.lgamma(x) 方法返回一个数字的自然对数伽玛值。 我们也可以通过使用 math.gamma() 方法找到伽玛值,然后使用 math.log() 方法计算该值的自然对数。 伽玛值等于 factorial(x-1) 。 Pytho...

  • Python math.log() 方法 日期:2022-09-11 点击:10566 python

    Python math.log(x) 方法使用一个参数,返回 x 的自然对数(底为 e )。 语法 math.log() 方法语法如下: math.log(x[, base]) 参数说明: x -- 必需,数字。如果 x 不是一个数字,返回 TypeError。如果...

  • Python math.log10() 方法 日期:2022-09-11 点击:5701 python

    Python math.log10(x) 方法返回 x 以 10 为底的对数。 语法 math.log10() 方法语法如下: math.log10(x) 参数说明: x -- 必需,数字。如果 x 不是一个数字,返回 TypeError。如果值为 0 或负数,则返回...

  • Python math.log1p() 方法 日期:2022-09-11 点击:7629 python

    Python math.log1p(x) 方法返回 1+x 的自然对数(以 e 为底)。 语法 math.log1p() 方法语法如下: math.log1p(x) 参数说明: x -- 必需,数字。如果 x 不是一个数字,返回 TypeError。如果值为 0 或负数...

  • Python math.log2() 方法 日期:2022-09-11 点击:8554 python

    Python math.log2(x) 方法返回 x 以 2 为底的对数。 语法 math.log2() 方法语法如下: math.log2(x) 参数说明: x -- 必需,数字。如果 x 不是一个数字,返回 TypeError。如果值为 0 或负数,则返回 V...

  • Python math.perm() 方法 日期:2022-09-11 点击:863 python

    Python math.perm(x, i) 方法返回不重复且有顺序地从 n 项中选择 k 项的方式总数。 注意:k 参数是可选的。 如果我们没有设置 k,这个方法将返回 n! (例如,math.perm(7) 将返回 5040)。 Pytho...

  • Python math.pow() 方法 日期:2022-09-11 点击:9561 python

    Python math.pow(x, y) 方法返回返回 x 的 y 次幂( 次方 )。 如果 x 为负且 y 不是整数,则返回 ValueError。该方法会将两个参数转换为浮点数。math.pow(1.0,x) 或 math.pow(x,0.0),始终返回 1.0。 语法...

  • Python math.prod() 方法 日期:2022-09-11 点击:5646 python

    Python math.prod() 方法用于计算可迭代对象中所有元素的积。 Python 版本:3.8 语法 math.prod() 方法语法如下: math.prod(iterable, start) 参数说明: iterable -- 必需,可迭代对象。 start -- 可选,指...

  • Python math.radians() 方法 日期:2022-09-11 点击:6680 python

    Python math.radians(x) 方法将角度 x 从度数转换为弧度。 math.degrees() 方法将弧度值转换为度数。 Python 版本:2.0 语法 math.radians() 方法语法如下: math.radians(x) 参数说明: x -- 必需,数字。如果...