Python中的math 模块和cmath 模块

 时间:2024-10-21 17:41:12

Python中的数学运算常用的几种函数基本都在math 模块和cmath 模块里,下面简单介绍下math 模块和cmath 模块。

Python中的math 模块和cmath 模块

工具/原料

电脑

python

math 模块:

1、要使用 math模块的函数必须先导入:import math。

Python中的math 模块和cmath 模块

2、查看math模块的函数内容:dir(math)。

Python中的math 模块和cmath 模块

3、math 模块提供了许多对浮点数的数学运算函数。

Python中的math 模块和cmath 模块

cmath 模块:

1、要使用 cmath模块的函数必须先导入:import cmath。

Python中的math 模块和cmath 模块

2、查看cmath模块的函数内容:dir(cmath)。

Python中的math 模块和cmath 模块

3、cmath 模块运算的是复数,和math模块不一样。

Python中的math 模块和cmath 模块
  • python怎么换行输入
  • Python编程:怎么输出“hello world”
  • 如何在Lightroom中编辑人像照片
  • 取整函数在C++的使用技巧
  • sublime 3如何实现在网页上添加图片与超链接
  • 热门搜索
    湖南长沙旅游攻略 山西五台山旅游攻略 蓝牙手柄怎么连接电脑 天龙八部单机版攻略 怎么移民美国 艾芙洛洗发水怎么样 海口美食攻略 通天河副本详细攻略 冰点脱毛怎么样 镇江旅游攻略