Python math.erf() 方法
实例
不同数字的打印误差函数:
# Import math Library
import math
# 不同数字的打印错误函数
print (math.erf(0.67))
print (math.erf(1.34))
print (math.erf(-6))
亲自试一试 »
定义和用法
math.erf()方法返回一个数的误差函数。
此方法接受 -inf 和 +inf 之间的值,并返回 -1 到 +1 之间的值。
语法
math.erf(x)
参数值
| 参数 | 描述 |
|---|---|
| x | 必需。一个数找误差函数 |
技术细节
| 返回值: | 一个float值,代表一个数的误差函数 |
|---|---|
| Python 版本: | 3.2 |

