Python log10(),x>0,返回以10为底的x的对数。
import math math.log10( x )
x - 数值表达式。
此方法返回x>0的x的以10为底的对数。
以下示例显示log10()方法的用法。
#!/usr/bin/python import math # This will import math module print "math.log10(100.12) : ", math.log10(100.12) print "math.log10(100.72) : ", math.log10(100.72) print "math.log10(119L) : ", math.log10(119L) print "math.log10(math.pi) : ", math.log10(math.pi)
当无涯教程运行上面的程序时,它产生以下输出-
math.log10(100.12) : 2.00052084094 math.log10(100.72) : 2.0031157171 math.log10(119L) : 2.07554696139 math.log10(math.pi) : 0.497149872694
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)