0
点赞
收藏
分享

微信扫一扫

软件测试学习笔记丨Python 内置库 科学计算

本文转自测试人社区,原文链接:https://ceshiren.com/t/topic/27035

math 函数

  • python 提供的内置数学类函数库,包含了很多数学公式,比如幂函数运算,三角函数,高等函数运算等

math 函数操作

  • 数字常数
  • 数论与表示函数
  • 幂对数函数
  • 三角对数函数
  • 高等特殊函数

数字常量

常数

数学表示

描述

math.pi

π

圆周率,值为3.1415926535…

math.e

e

自然对数,值为2.7182818…

math.inf


正无穷大,负无穷 -math.inf

math.nan

NAN

非数字NAN(Not a Number)

import math

print(math.pi) # 3.141592653589793
print(math.e) # 2.718281828459045
print(math.inf) # inf
print(-math.inf) # -inf
print(math.nan) # nan

数论与表示函数

软件测试学习笔记丨Python 内置库 科学计算_函数库

举报

相关推荐

0 条评论