python math.erfc()方法,获取余误差函数值

math.erfc()方法

python的math模块中的efrc()方法,可以获取参数指定值的余误差函数值。


erfc()语法

erfc(x)

python源码对erfc()方法的介绍:

    Complementary error function at x.

参数

参数描述
x必须参数,real number,如int或float等类型

提示:如果参数不是real number,python将抛出TypeError。


返回值

Python浮点数float类型值。


math.erfc()方法实例代码

>>> import math
>>> math.erfc(1)
0.157299207050285
>>> math.erfc(0)
1.0
>>> math.erfc(-2)
1.9953222650189528
>>> math.erfc('3')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: must be real number, not str

全栈后端 / Python库 :









Copyright © 2022-2024 笨鸟工具 x1y1z1.com All Rights Reserved.