python库-math.docx


文档分类:IT计算机 | 页数:约16页 举报非法文档有奖
1/16
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/16
文档列表 文档介绍
import math
dir(math)
Out[2]:
['__doc__',
'__name__',
'__package__',
'acos',---反余弦
'acosh',---反双曲余弦
'asin',---反正弦
'asinh',---反双曲正弦
'atan',---反正切
'atan2',---(y,x),y/x的反正切
'atanh',---反双曲正切
'ceil',---返回>=x的最小整数,反floor
'copysign',---(x,y),返回与y同号的x值(改变x值符号)
'cos',---余弦
'cosh',---反余弦
'degrees',---将弧长转化为角度,反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阵列各项和,([2,5])
'gamma',---伽马函数
'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 为反函数
'sin',---正弦
'sinh',---反正弦
'sqrt',---开根号
'tan',---正切
'tanh',---反正切
'trunc']--- 返回 x 的整数部份,等同 int,似modf
两个常量pi,e
举例:
(5,3)
Out[12]:
In [14]: (-5,3)
Out[14]: -
In [15]: (5,-3)
Out[15]:
In [16]: (-5,-3)
Out[16]: -
5%3
Out[17]: 2
5%(-3)
Out[19]: -1
-5%3
Out[20]: 1
-5%(-3)
Out[21]: -2
官方文档:
. math — Mathematical functions
This module is always available. It provides access to the mathematical functions defined by the C standard.
These functions cannot be used plex numbers; use the functions of the same name from the cmath module if you require support plex numbers. The distinction between functions which plex numbers and those which don’t is made since most users do not want to learn quite as much mathematics as required to plex numbers. Receiving an exception instead of plex result allows earlier detection of the plex number used as a parameter, so that the programmer can determine how and why it was gene

python库-math 来自淘豆网m.daumloan.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数16
  • 收藏数0 收藏
  • 顶次数0
  • 上传人mh900965
  • 文件大小20 KB
  • 时间2017-12-21
最近更新