下列哪个不是目前python里的内置模块-python的内置模块math在哪个文件里

匿名用户

1级

2018-09-03 回答

函数 说明 实例 math.e 自然常数e >>> math.e2.718281828459045 math.pi 圆周率pi >>> math.pi3.141592653589793 math.degrees(x) 弧度转度 >>> math.degrees(math.pi)180.0 math.radians(x) 度转弧度 >>> math.radians(45)0.7853981633974483 math.exp(x) 返回e的x次方 >>> math.exp(2)7.38905609893065 math.expm1(x) 返回e的x次方减1 >>> math.expm1(2)6.38905609893065 math.log(x[, base]) 返回x的以base为底的对数,base默认为e >>> math.log(math.e)1.0>>> math.log(2, 10)0.30102999566398114 math.log10(x) 返回x的以10为底的对数 >>> math.log10(2)0.30102999566398114 math.log1p(x) 返回1+x的自然对数(以e为底) >>> math.log1p(math.e-1)1.0 math.pow(x, y) 返回x的y次方 >>> math.pow(5,3)125.0 math.sqrt(x) 返回x的平方根 >>> math.sqrt(3)1.7320508075688772 math.ceil(x) 返回不小于x的整数 >>> math.ceil(5.2)6.0 math.floor(x) 返回不大于x的整数 >>> math.floor(5.8)5.0 math.trunc(x) 返回x的整数部分 >>> math.trunc(5.8)5 math.modf(x) 返回x的小数和整数 >>> math.modf(5.2)(0.20000000000000018, 5.0) math.fabs(x) 返回x的绝对值 >>> math.fabs(-5)5.0 math.fmod(x, y) 返回x%y(取余) >>> math.fmod(5,2)1.0 math.fsum([x, y, ...]) 返回无损精度的和 >>> 0.1+0.2+0.30.6000000000000001>>> math.fsum([0.1, 0.2, 0.3])0.6 math.factorial(x) 返回x的阶乘 >>> math.factorial(5)120 math.isinf(x) 若x为无穷大,返回True;否则,返回False >>> math.isinf(1.0e+308)False>>> math.isinf(1.0e+309)True math.isnan(x) 若x不是数字,返回True;否则,返回False >>> math.isnan(1.2e3)False math.hypot(x, y) 返回以x和y为直角边的斜边长 >>> math.hypot(3,4)5.0 math.copysign(x, y) 若y<0,返回-1乘以x的绝对值; 否则,返回x的绝对值 >>> math.copysign(5.2, -1)-5.2 math.frexp(x) 返回m和i,满足m乘以2的i

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值