模块03----Math (部分常用)

返回≧ x 的最小整數  math.ceil(x)    >>> math.floor(3.4) 結果 4
返回 ≦ x 的最大整数  math.floor(x)    >>> math.floor(3.4) 結果 3
返回与 y 同号的 x 值  math.copysign(x,y)
返回e**x   math.exp(x)
返回 x 的绝对值   math.fabs(x) 
返回x的阶乘   math.factorial(x)   >>> math.factorial(5) = 120
返回x,y的算术平方根    math.hypot(x,y)
返回 m×2**n   math.ldexp(m,n)
返回log a底 x       math.log(x,a)
返回 x 的小数部份与整数部份 math.modf(x)
返回常数 π (3.14159...) math.pi
返回x的y次幂               math.pow(x,y)
开方      math.sqrt(x)
返回 x 的整数部份,等同 int math.trunc(x)

將 x (弧长) 转成角度,与 radians 为反函数 math.degrees(x)
將 x(角度) 转成弧长,与 degrees 为反函数 math.radians(d)
若x不是数字,返回True;否则,返回False math.isnan(x)   >>> math.isnan(1.2e3)  False
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值