【Python】Python语言math模块可用函数
生活随笔
收集整理的這篇文章主要介紹了
【Python】Python语言math模块可用函数
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
| mathe.e | 自然常數e |
| mathe.pi | 圓周率π |
| mathe.degrees(x) | 弧度轉角度 |
| mathe.radians(x) | 角度轉弧度 |
| mathe.exp(x) | 返回e的x次冪 |
| mathe.expm1(x) | 返回e的x次冪-1 |
| mathe.log(x[, base]) | 返回x的basee為底的對數,base默認為e |
| mathe.log10(x) | 返回x的以10為底的對數 |
| mathe.log1p(x) | 返回(1+x)的自然對數 |
| mathe.pow(x, y) | 返回x的y次冪 |
| mathe.sqrt(x) | 返回x的平方根 |
| mathe.ceil(x) | 返回不小于x的整數 |
| mathe.floor(x) | 返回不大于x的整數 |
| mathe.trunc(x) | 返回x的整數部分 |
| mathe.modf(x) | 返回x的小數和整數 |
| mathe.fabs(x) | 返回x的絕對值 |
| mathe.fmod(x, y) | 返回x%y(取余) |
| mathe.fsum([x, y, …]) | 返回無損精度的和 |
| mathe.factorial(x) | 返回x的階乘 |
| mathe.isinf(x) | 若x為無窮大,返回True;否則返回False |
| mathe.isnan(x) | 若x不是數字,返回True;否則返回False |
| mathe.hypot(x, y) | 返回x,y為直角邊的直角三角形的斜邊長 |
| mathe.copysign(x, y) | 若y<0,返回-1乘以x的絕對值;否則返回x的絕對值 |
| mathe.frexp(x) | 返回m和i,滿足m乘以2的i次冪 |
| mathe.ldexp(m, i) | 返回m乘以2的i次冪 |
| mathe.sin(x) | 返回x的(角度的)三角正弦值 |
| mathe.asin(x) | 返回x的反三角正弦值 |
| mathe.cos(x) | 返回x的(角度的)三角余弦值 |
| mathe.acos(x) | 返回x的反三角余弦值 |
| mathe.tan(x) | 返回x的(角度的)三角正切值 |
| mathe.atan(x) | 返回x的反三角正切值 |
| mathe.atan2(x, y) | 返回x/y的反三角正切值 |
| mathe.sinh(x) | 返回x的雙曲正弦函數 |
| mathe.asinh(x) | 返回x的反雙曲正弦函數 |
| mathe.cosh(x) | 返回x的雙曲余弦函數 |
| mathe.acosh(x) | 返回x的反雙曲余弦函數 |
| mathe.tanh(x) | 返回x的雙曲正切函數 |
| mathe.atanh(x) | 返回x的反雙曲正切函數 |
| mathe.erf(x) | 返回x的誤差函數 |
| mathe.erfc(x) | 返回x的余誤差函數 |
| mathe.gamma(x) | 返回x的伽馬函數 |
| mathe.lgamma(x) | 返回x的絕對值的自然對數的伽馬函數 |
總結
以上是生活随笔為你收集整理的【Python】Python语言math模块可用函数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [计数排序]统计三个数和的[最大概率](
- 下一篇: 【Python】Magician“专属”