當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python math.erf用法及代碼示例

用法:

math.erf(x)

x 返回 error function

erf() 函數可用於計算傳統統計函數,例如 cumulative standard normal distribution

def phi(x):
    'Cumulative distribution function for the standard normal distribution'
    return (1.0 + erf(x / sqrt(2.0))) / 2.0

3.2 版中的新函數。

相關用法


注:本文由純淨天空篩選整理自python.org大神的英文原創作品 math.erf。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。