小白教程
所有教程
关于
Search
172.69.59.80
172.69.59.80
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Ref math gamma”的源代码
本页内容
上一节:
Ref_math_fsum
下一节:
Ref_math_gcd
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:math.gamma(x)}}[[Category:python math|30]] = Python math.gamma() 方法 = [[python math|Python math 模块]] Python '''math.gamma(x)''' 方法返回 x 处的伽玛函数(Gamma 函数)。 伽玛函数,也叫欧拉第二积分,是阶乘函数在实数与复数上扩展的一类函数。 要查找数字的对数伽玛值,请使用 [[ref math lgamma|math.lgamma()]] 方法。 Python 版本: 3.2 === 语法 === math.gamma() 方法语法如下: <sample title="" desc="" lang="python" hererun="1"> math.gamma(x) </sample> '''参数说明:''' * '''x''' -- 必需,数字。如果数字是负整数,则返回 ValueError。 如果不是数字,则返回 TypeError。 === 返回值 === 一个浮点值,表示表示 x 处的伽玛函数。 == 以下实例计算不同数的伽玛函数: <sample title="" desc="" lang="python" hererun="1"> # 导入 math 包 import math # 计算不同数的伽玛函数 print(math.gamma(-0.1)) print(math.gamma(8)) print(math.gamma(1.2)) print(math.gamma(80)) print(math.gamma(-0.55)) </sample> 输出结果: <sample title="" desc="" lang="python" hererun="1"> -10.686287021193193 5040.0 0.9181687423997604 8.946182130782976e+116 -3.578429819277059 </sample> [[python math|Python math 模块]]
返回至“
Ref math gamma
”。
上一节:
Ref_math_fsum
下一节:
Ref_math_gcd