python库-math

python库-math

ID:38289329

大小:20.43 KB

页数:8页

时间:2019-06-07

python库-math_第1页
python库-math_第2页
python库-math_第3页
python库-math_第4页
python库-math_第5页
资源描述:

《python库-math》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、importmathdir(math)Out[2]:['__doc__','__name__','__package__','acos',---反余弦'acosh',---反双曲余弦'asin',---反正弦'asinh',---反双曲正弦'atan',---反正切'atan2',---math.atan(y,x),y/x的反正切'atanh',---反双曲正切'ceil',---返回>=x的最小整数,反floor'copysign',---math.copysign(x,y),返回与y同号的x值(改变x值符号)'cos',---余弦'cosh',---反余弦'de

2、grees',---将弧长转化为角度,反radians'e',---2。7128'erf',---误差函数'erfc',---1-erf'exp',---e的x次方'expm1',---e的x次方-1'fabs',---绝对值'factorial',---x阶乘'floor',---返回<=x的最大整数,反ceil'fmod',---返回x对y取模的余数,以x来决定余数的符号,%以y来决定余数的符号'frexp',---反ldexp,frexp(x),返回m,n'fsum',---返回x阵列各项和,例math.frexp([2,5])'gamma',---伽马函数'

3、hypot',---hypot(x,y)平方和开根号'isinf',---是否为正负无穷大,是则true'isnan',---x=NaN,true,x为0也返回false'ldexp',---ldexp(x,y),输出m*2的n次方,反frexp'lgamma',---伽马函数的自然对数'log',---log(x,a),a不写则为e'log10',---log10(x)'log1p',---返回 'modf',---返回x的小数部份与整数部份,似trunc'pi',---π'pow',---返回xy'radians',---將x(角度)转成弧长,与degrees为

4、反函数'sin',---正弦'sinh',---反正弦'sqrt',---开根号'tan',---正切'tanh',---反正切'trunc']---返回x的整数部份,等同int,似modf两个常量pi,e举例:math.fmod(5,3)Out[12]:2.0In[14]:math.fmod(-5,3)Out[14]:-2.0In[15]:math.fmod(5,-3)Out[15]:2.0In[16]:math.fmod(-5,-3)Out[16]:-2.05%3Out[17]:25%(-3)Out[19]:-1-5%3Out[20]:1-5%(-3)Out[2

5、1]:-2官方文档:9.2.math—MathematicalfunctionsThismoduleisalwaysavailable.ItprovidesaccesstothemathematicalfunctionsdefinedbytheCstandard.Thesefunctionscannotbeusedwithcomplexnumbers;usethefunctionsofthesamenamefromthecmathmoduleifyourequiresupportforcomplexnumbers.Thedistinctionbetweenfunct

6、ionswhichsupportcomplexnumbersandthosewhichdon’tismadesincemostusersdonotwanttolearnquiteasmuchmathematicsasrequiredtounderstandcomplexnumbers.Receivinganexceptioninsteadofacomplexresultallowsearlierdetectionoftheunexpectedcomplexnumberusedasaparameter,sothattheprogrammercandetermineho

7、wandwhyitwasgeneratedinthefirstplace.Thefollowingfunctionsareprovidedbythismodule.Exceptwhenexplicitlynotedotherwise,allreturnvaluesarefloats.9.2.1.Number-theoreticandrepresentationfunctionsmath.ceil(x)Returntheceilingofxasafloat,thesmallestintegervaluegreaterthanorequaltox.math.copy

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。