python标准库介绍——7 cmath 模块详解

  

[Example 1-61 #eg-1-61] 所展示的 ``cmath`` 模块包含了一些用于复数运算的函数.

====Example 1-61. 使用 cmath 模块====[eg-1-61]

```
File: cmath-example-1.py

import cmath

print "pi", "=>", cmath.pi
print "sqrt(-1)", "=>", cmath.sqrt(-1)

pi => 3.14159265359
sqrt(-1) => 1j

 

posted @ 2017-10-28 22:00  淋哥  阅读(1124)  评论(0编辑  收藏  举报