美文网首页
2018-03-17

2018-03-17

作者: 一朵_蒲公英 | 来源:发表于2018-03-17 09:48 被阅读0次

math库

>>>import math #导入math库


>>>math.ceil(1.03) #向上取整

>>>2


>>>math.floor(1.89) #向下取整

>>>1


>>>math.sqrt(81) #开方

>>>9


>>>math.fabs(-3) #绝对值

>>>3.0 #浮点数


>>>math.log(100,10) #对数

>>>2.0 #浮点数


>>>math.sin(x)

>>>math.cos(x) #x为弧度radian 


>>>math.asin(x)

>>>math.acos(x) # x取值[-1,1]

>>>[radian] #结果为弧度

相关文章

网友评论

      本文标题:2018-03-17

      本文链接:https://www.haomeiwen.com/subject/jsidqftx.html